Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

PartB-Unit3-Database Management system(Answers)

Uploaded by

Reeti Mahalwar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

PartB-Unit3-Database Management system(Answers)

Uploaded by

Reeti Mahalwar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

INFORMATION TECHNOLOGY (CODE – 402)

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

12. Which of the following can be used as a wildcard character?


a. Like

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’

17. __________ view is used to enter or edit the data.


d. Form view
18. To open the property sheet in Access, press the _________ key.
a. Alt+Enter
19. Which is not a part of Report Sections in Access.
a. View page

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

28. Which of the following is not the advantage of database?


c. Increase Data Inconsistency
29. Which of the following store command to retrieve data from database?
b. Query
30. By default, the length of varchar data type is _________
d. 50
31. Which language help to extract/fetch data from table?
a. MYSQL

32. Which of the clause return records in ascending order?


a. Order By

33. Shortcut to execute query in Create Query in SQL View is:


a. F5 Key

34. In a datasheet, what does each column represent?


a. Field
35. ___________ data types are used for storing photos, music files etc.
d. Special
36. By default, the length of the Integer data type is ________
a. 10
37. The task of arranging data in order is called:
b. Sorting

APPLICATION BASED QUESTIONS/CASE STUDY BASED/COMPETENCY BASED (Write the


Answers)

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.

Q61. Answer the following questions on the basis of following table:


Table:Student
Stu_id Stu_Name Class Fees

1 Aman IX 3000

2 Anil X 3200

Table:Teacher
T_i T_Name T_Sal Stu_id Subject
d

3210 Mrs. Rajshree 65000 2 Maths

3211 Mr. Sahani 72000 1 Science

3241 Mrs. Dixit 75000 1 English


i.Identify the primary key field in the Student and Teacher table.
Ans: Primary key field in the student table is student id (Stu_id) and in the Teacher's table is
teachers id (T_id).
ii. Identify the foreign key in the Teacher table.
Ans: The foreign key in the Teacher's table is student id(Stu_id)
iii.Write the SQL query to display the teacher’s name teaching “Stu_id=1”.
Ans: Select T_Name from Teacher where Stu_id=1;
Long Questions:
Q62. State the difference between Flat File based database management system and Hierarchical
database management system along with the help of examples.
Ans 62. Flat file-based database management systems also known as flat models are the simplest database
management systems. These store information in the flat file having rows and columns to store data. Flat
while cannot be linked to each other. Thus, data cannot be viewed from multiple files at the same time.
Spreadsheet software such as MS Excel is the most common example of a flat file-based data management
system.
Hierarchical database management system functions on the parent child tree like model these store the data
items along with the description of the data items such as a book with information on chapters and verses.
These can also be used to store a database of songs, recipes, models of phones and anything that can be
stored in a nested format. The XML document is an example of a hierarchical database management system.
Q63.What are database objects?
Ans 63. The objects are as follows:
1. Query: A query is a question put up on the database to view the records matching the criteria defined
by us. Using a query we can view or manipulate a selected set of data stored in a single table or
multiple related tables.
2. For: A form is a graphical object that acts as an interface between a user and the tables where the
data is stored. With forms we can view ,edit ,input and delete records stored in the tables. Forms
allow us to deal with one record at a time. Report is a graphical object that presents data with a
formatted layout. This is useful for displaying data in an organized manner and for printing.
3. Macros and code: A set of actions created to automate common tasks is known as a macro. Code
refers to the declaration statements and procedures written in the programming language.
Q64. Differentiate between record and field in a table. Give examples.
Ans 64.

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.

The record is also known as tuple. Field is also known as an attribute.

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

Regd.No NAME BRANCH

0001 RAM CSE

0002 HARI MECH

0003 PRADEEP EEE

0004 DEEPAK ETC


I. Write a SQL command which will show the entire STUDENT table.
Ans: Select * from STUDENT;
II. Write a SQL command which will show the Regd.No of PRADEEP.
Ans: Select Regd.No from student where NAME= “PRADEEP”;
III. Write a SQL command which will show the NAME and BRANCH column.
Ans: Select NAME, BRANCH from STUDENT;
IV. Write a SQL command which will count the number of rows existing in the STUDENT
table.
Ans:Select Count(Regd.No) as No. OF STUDENTS from Student;
V. I want another column in the STUDENT table as “ADDRESS”. How can I do that?
Ans: We will use the ALTER command of SQL.
ALTER Table STUDENT Add column ADDRESS varchar(20);

You might also like