0% found this document useful (0 votes)
70 views82 pages

Unit 8 DBMS

Uploaded by

rs.aishwarya2709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views82 pages

Unit 8 DBMS

Uploaded by

rs.aishwarya2709
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

INFORMATION TECHNOLOGY (402)

CLASS-10 UNIT-8: DATABASE MANAGEMENT SYSTEM

MULTIPLE CHOICE QUESTIONS

1. A __________ is an organized collection of data.


a. Database
b. Digital Document
c. Spreadsheet
d. None of the above
ANSWER
a. Database
2. A _________ is a software package that can be used for creating
and managing databases.
a. Database Management System
b. Basedata Management System
c. Database Manage System
d. None of the above
ANSWER
a. Database Management System
3. A _________________ database management system is referred to
as a relational model.
a. DBMS
b. RDBMS
c. DB
d. None of the above
ANSWER
b. RDBMS
4. Example of the database ________.
a. Microsoft Access
b. OpenOffice Base
c. MySQL
d. All of the above
ANSWER
d. All of the above
5. The database concept has evolved since the _____ _.
a. 1980
b. 1960
c. 1955
d. 1950
ANSWER
b. 1960
6. DBMS Stands for _________ _.
a. Database Management System
b. Database Manage System
c. Data Manage System
d. None of the above
ANSWER
a. Database Management System
7. A database management system is a software package with
computer programs that controls the __________ _.
a. Creation
b. Maintenance
c. Use of Database
d. All of the above
ANSWER
d. All of the above
8. A database is an integrated collection of __________ _.
a. Data records
b. Files
c. Objects
d. All of the above
ANSWER
d. All of the above
9. A DBMS enables several user application programs to access
the ________ database.
a. Other Database
b. Same Database
c. Both a) and b)
d. None of the above
ANSWER
b. Same Database
10. Data can be organized into _________ _.
a. Flat File
b. Relational
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
11. Data stored in a single table is known as _________ _.
a. Flat File
b. Relational
c. Both a) and b)
d. None of the above
ANSWER
a. Flat File
12. Data is stored in multiple tables, which are connected
together via a common field.
a. Flat File
b. Relational
c. Both a) and b)
d. None of the above
ANSWER
b. Relational
13 ___________ are dedicated computers that hold the actual
databases and run only the DBMS and related software.
a. Database Server
b. Decided Server
c. Web Server
d. None of the above
ANSWER
a. Database Server
14. What are the advantages of database _________ _.
a. Reduces Data Redundancy
b. Sharing of Data
c. Data Integrity
d. All of the above
ANSWER
d. All of the above
15. When the same piece of data is stored in two or more
locations, it is called _____________ _.
a. Data Redundancy
b. Data Integrity
c. Data Consistency
d. None of the above
ANSWER
a. Data Redundancy
16 prevents creating multiple copies in the database.
a. Data Redundancy
b. Data Integrity
c. Data Consistency
d. None of the above
ANSWER
a. Data Redundancy
17 means that the data is accurate and consistent in
the database.
a. Data Redundancy
b. Data Integrity
c. Data Consistency
d. None of the above
ANSWER
b. Data Integrity
18. Only authorized users should be allowed to access the
database and their identity should be authenticated using a
username and password known as ________.
a. Data Redundancy
b. Data Consistency
c. Data Security
d. None of the above
ANSWER
c. Data Security
19. Database Management System automatically takes care of
____________.
a. Data Redundancy
b. Backup and Recovery
c. Data Security
d. None of the above
ANSWER
b. Backup and Recovery
20 prevent multiple mismatching copies of the same
data in the database and only valid data will be added in the
database.
a. Data Redundancy
b. Backup and Recovery
c. Data Consistency
d. None of the above
ANSWER
c. Data Consistency
21 in a table represents a set of information with the
same structure in every row.
a. Tuples
b. Record
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
22. A __________ is the actual text, number, or date that you enter
when adding data to your database.
a. Values
b. Table
c. Boolean
d. None of the above
ANSWER
a. Values
23. The unique field present in the table is called _________ _.
a. Primary Key
b. Candidate Key
c. Foreign Key
d. None of the above
ANSWER
a. Primary Key
24. When the primary key is applied on multiple columns is
known as ________ _.
a. Primary Key
b. Composite Primary Key
c. Foreign Key
d. None of the above
ANSWER
b. Composite Primary Key
25. By default if the primary key is not defined that column is
known as ________ _.
a. Primary Key
b. Candidate Key
c. Foreign Key
d. None of the above
ANSWER
c. Foreign Key
26 ___________ key can store multiple same records in the table.
a. Primary Key
b. Candidate Key
c. Foreign Key
d. None of the above
ANSWER
c. Foreign Key
27. The relationship between two tables where one table has
one record and another table has many records is known as
___________.
a. One-to-Many
b. Many-to-Many
c. Many-to-One
d. None of the above
ANSWER
a. One-to-Many
28. SQL stands for ____________ _.
a. Single Query Language
b. Structured Query Language
c. Semantic Query Language
d. None of the above
ANSWER
b. Structured Query Language
29. A ____________ is a collection of data components organized in
the form of vertical columns and horizontal rows.
a. Table
b. Fields
c. Attributes
d. None of the above
ANSWER
a. Table
30. A row also called a Record or __________represents a single,
data item in a table.
a. Column
b. Tuples
c. Fields
d. None of the above
ANSWER
b. Tuples
31. You can create tables in the database using _______ _.
a. Wizard
b. SQL
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
32 are the basic building blocks of a database.
a. Table
b. Query
c. Database
d. None of the above
ANSWER
a. Table
33 are used to define the type of data that will be
stored in the database.
a. Data Types
b. Data field
c. Key Data
d. None of the above
ANSWER
a. Data Types
34. What are the different types of data type available in
OpenOffice base?
a. Numeric Types
b. Alphanumeric Types
c. Binary Types & Date time
d. All of the above
ANSWER
d. All of the above
35 types are used for describing numeric values for
the field used in the table of a database.
a. Numeric Type
b. Alphanumeric Type
c. Boolean Type
d. Date & Time
ANSWER
a. Numeric Type
36 data type can store 0 or 1 in the database.
a. Boolean
b. TinyInt
c. Smalint
d. BigInt
ANSWER
a. Boolean
37. What are the different numerical data types?
a. Boolean
b. Tinyint & Smallint
c. Integer & Bigint
d. All of the above
ANSWER
d. All of the above
38 data type can store UTF 8 Characters in the
database.
a. Longvarchar
b. Char
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
39 is case sensitive data type in the database.
a. Longvarchar
b. Varchar_Ignorecase
c. Varchar
d. All of the above
ANSWER
b. Varchar_Ignorecase
40 data types in a database can be used for storing
photos, music, video or any file format.
a. Numerical Type
b. Alphanumeric Type
c. Binary Type
d. Date & Time
ANSWER
c. Binary Type
41. Which datatype is used for storing date and time both in the
database.
a. Date
b. Time
c. Timestamp
d. None of the above
ANSWER
c. Timestamp
42. A table is a collection of data elements that are organized
using a vertical __________ and horizontal ____________ model.
a. Column & Row
b. Row & Column
c. Column & Column
d. Row & Row
ANSWER
a. Column & Row
43. A ________ is a collection of data values of a specific type, one
for each row of a table.
a. Column
b. Row
c. Cell
d. None of the above
ANSWER
a. Column
44. In a table, a ___________ represents a single data item.
a. Row
b. Truple
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
45 ______________ are used to identify which type of data we are
going to store in the database.
a. Datatype
b. DataItem
c. DataValue
d. DataCat
ANSWER
a. Datatype
46. There are_________ ways to create a table.
a. 1
b. 2
c. 3
d. 4
ANSWER
b. 2
47. Field properties can be set in both the ________ and ________ _ .
a. Length & Default Value
b. Length & Entry
c. Both a) and b)
d. All of the above
ANSWER
c. Both a) and b)
Session 3: Perform Operations of Table
48. By default the length of the numerical data type is ______ _.
a. 05
b. 10
c. 20
d. 30
ANSWER
b. 10
49. If the user does not specify a value for a field while putting
values into the table, a _____________ value can be assigned to it.
a. Default Value
b. Length
c. Format
d. None of the above
ANSWER
a. Default Value
50 means to arrange the data in either ascending order
or descending order.
a. Filter
b. Sorting
c. Arrangement
d. None of the above
ANSWER
b. Sorting
51 is used to maintain accuracy and consistency of
data in a relationship.
a. Referential data
b. Referential Integrity
c. Referential Value
d. None of the above
ANSWER
b. Referential Integrity
52. In base, data can be linked between two or more tables with
the help of ___________ _.
a. Primary Key
b. Foreign Key
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
53. Referential Integrity helps to avoid ____________.
a. If you want to add a record in the related table and if there is no
associated record available in the primary key table.
b. Changing values in a primary if there are any dependent records
in the related table.
c. Deleting records from a primary key table if there are any
matching related records available in the associated table.
d. All of the above
ANSWER
d. All of the above
54. The connection or association between two or more table is
known as ____________
a. Connection
b. Relationship
c. Connector
d. None of the above
ANSWER
b. Relationship
55. Relationships between tables help to _________ _.
a. Save time
b. Reduce data-entry errors
c. Summarize data from related tables
d. All of the above
ANSWER
d. All of the above
56. What are the different types of relationships which can be
created in table _________ _.
a. One to One
b. One to Many or Many to One
c. Many to Many
d. All of the above
ANSWER
d. All of the above
57 is the relationship, where both the tables must
have primary key columns.
a. One to One
b. One to Many or Many to One
c. Many to Many
d. All of the above
ANSWER
a. One to One
58 in this relationship, one of them must have a
primary key column.
a. One to One
b. One to Many or Many to One
c. Many to Many
d. All of the above
ANSWER
b. One to Many or Many to One
59. A ____________________ is a standard for commands that define
the different structures in a database.
a. Data Manipulation Language (DML)
b. Data Definition Language (DDL)
c. Both a) and b)
d. None of the above
ANSWER
b. Data Definition Language (DDL)
60. A ______________ is a language that enables users to access and
manipulate data in a database.
a. Data Manipulation Language (DML)
b. Data Definition Language (DDL)
c. Both a) and b)
d. None of the above
ANSWER
a. Data Manipulation Language (DML)
61. A ____________ is a subset of DML that just deals with
information retrieval.
a. Query Language
b. Structure Language
c. Both a) and b)
d. None of the above
ANSWER
a. Query Language
62. A popular data manipulation language is _________________.
a. Structured Query Language
b. Machine Level language
c. Low level language
d. None of the above
ANSWER
a. Structured Query Language
63. There are___________ types of Relationships in a table.
a. 2
b. 3
c. 4
d. 5
ANSWER
b. 3
Session 4: Retrieve data using Query
64 __________ means that the query hides certain data and
displays only what you want to see based on the criteria you
provided.
a. Filtering
b. Sort
c. Query
d. All of the above
ANSWER
a. Filtering
65. A __________ statement used to display the zero record or
multiple record from the database.
a. Select
b. Order By
c. Where
d. None of the above
ANSWER
a. Select
66. To retrieve all the columns in a table the syntax is __________ _.
a. Select $ from <tablename>;
b. Select * <tablename>;
c. Select * from <tablename>;
d. Select % <tablename>;
ANSWER
c.
67. To display the records containing the same type of values
_________ clause can be used with the Select SQL Command.
a. Where
b. More
c. Order
d. None of the above
ANSWER
a. Where
68. Shortcut key for executing query in OpenOffice base.
a. F2
b. F3
c. F4
d. F5
ANSWER
d. F5
69. To view records in ascending order from a database.
a. Unorder by
b. Order by
c. Acc by
d. Decc by
ANSWER
b. Order by
70 ____________ statement is used for modifying records in a
database.
a. Modify
b. Update
c. Delete
d. Select
ANSWER
b. Update
71. The syntax of the update statement is ___________ _.
a. Update <tablename> set <columnname = value> where
<condition>;
b. Update <tablename> set <condition> where <condition>;
c. Modify <tablename> set < value> where <condition>;
d. Modify <tablename> set <columnname = value> where
<condition>;
ANSWER
a.
72. A _______ helps the user to systematically store information
in the database.
a. Form
b. Table
c. Report
d. None of the above
ANSWER
a. Form
73. A ________ enables users to view, enter, and change data
directly in database objects such as tables.
a. Table
b. Form
c. Report
d. None of the above
ANSWER
b. Form
74 __________ statement retrieves zero or more rows from one or
more database tables or database views.
a. Select
b. Update
c. Delete
d. None of the above
ANSWER
a. Select
75. By default, data is arranged in________ order using ORDER BY
clause.
a. Ascending
b. Descending
c. Both a) and b)
d. None of the above
ANSWER
a. Ascending
76 ___________ statement is used for modifying records in a
database.
a. Select
b. Update
c. Delete
d. None of the above
ANSWER
b. Update
77. To remove one or more records from a database, use the
_________ statement.
a. Select
b. Update
c. Delete
d. None of the above
ANSWER
c. Delete
78. A __________ provides the user a systematic way of storing
information into the database.
a. Query
b. Form
c. Table
d. None of the above
ANSWER
b. Form
79 ___________ will help you to display summarized data from the
database.
a. Report
b. Form
c. Table
d. None of the above
ANSWER
a. Report
80. To create a form you need to select the __________option
available under the Database section.
a. Form
b. Query
c. Report
d. All of the above
ANSWER
a. Form
81. A ______ helps to collect specific information from the pool of
data in the database.
a. Form
b. Query
c. Report
d. All of the above
ANSWER
b. Query
82 is used to display the summary of data.
a. Form
b. Query
c. Report
d. All of the above
ANSWER
c. Report
83 are the interfaces with which the user interacts.
a. Form
b. Query
c. Report
d. All of the above
ANSWER
a. Form
84. Data from multiple tables can be stored in______ _.
a. Data system
b. Database
c. Datatype
d. None of the above
ANSWER
b. Database
85. Which data type is suitable for storing values for ‘date of
birth’ field?
a. Time
b. Date
c. Both of the above
d. Timestamp
ANSWER
b. Date
Extra MCQs Questions and Answers
86. Which data type is most suitable for storing a very large
amount of data?
a. LongVarchar or Memo
b. Char
c. Varchar
d. Varchar_IgnoreCase
ANSWER
a. LongVarchar or Memo
87. Identify the odd one out.
a. Binary Types
b. Date & Day Type
c. Numeric Types
d. Alphanumeric Types
ANSWER
b. Date & Day Type
88. What does a single data item in a table represent?
a. Columns
b. Attribute
c. Rows
d. Field
ANSWER
c. Rows
89. Which toolbar helps us move from one record to another in
a form in a database?
a. Formatting Toolbar
b. Image Toolbar
c. Standard Toolbar
d. Form Navigation Toolbar
ANSWER
d. Form Navigation Toolbar
90. What is the correct query to increase the salary of all
employees by Rs.10000 in a table named Employee with a
column name of Salary?
a. Update Employee set Salary = Salary + 10000;
b. Update * Employee set Salary = Salary + 10000.
c. Update table Employee set Salary = Salary + 10000;
d. Update table Employee set Salary = 10000;
ANSWER
a. Update Employee set Salary = Salary + 10000;
91. Which query will display the details of all the students in
increasing order of Roll number?
a. Select * from student order by ‘Rollno’;
b. Select * student order by ‘Rollno’;
c. Select all from student order by ‘Rollno’;
d. Select * from student orderby ‘Rollno’;
ANSWER
a. Select * from student order by ‘Rollno’;
92. Which clauses can be used with the SELECT statement?
a. Order by Clause
b. Where clause
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
93. In which relationship, no table has the primary key column?
a. Many to One
b. One to One
c. Many to Many
d. One to Many
ANSWER
c. Many to Many
94. Referential integrity refers to the _______________ between
tables.
a. communication
b. consistency
c. relationship
d. joining
ANSWER
c. relationship
95. Which field property in Base must be set to “Yes” in order to
require a value to be entered in a field?
a. Entry Required
b. Auto Value
c. Format
d. Length
ANSWER
a. Entry Required
96. In which view can field properties be set in Base?
a. Design View
b. Datasheet View
c. Both of the above
d. None of the above
ANSWER
a. Design View
97. Which of the following is a benefit of using a database
management system?
a. Improved data security
b. Improved data accessibility
c. Improved data consistency
d. All of the above
ANSWER
d. All of the above
98. Which of the following is NOT a type of database model?
a. Relational
b. Object-oriented
c. Hierarchical
d. Procedural
ANSWER
d. Procedural
99. Which of the following is an example of an open-source
RDBMS?
a. Oracle
b. Microsoft Access
c. OpenOffice Base
d. Microsoft SQL Server
ANSWER
c. OpenOffice Base
100. What is the purpose of a report in a database?
a. Report is used to display information.
b. Report is systematic way of storing information into the table.
c. Both a) and b)
d. None of the above.
ANSWER
a. Report is used to display information.
101. What is the purpose of a form in a database?
a. Form is systematic way of storing information into the table.
b. Form is used to display information.
c. Both a) and b)
d. None of the above.
ANSWER
a. Form is systematic way of storing information into the table.
102. Which SQL command will increase the salary of all
employees by 5000? (Table name is emp and column name is
salary).
a. UPDATE emp SET sal = salary + 5000;
b. UPDATE SET sal = salary + 5000;
c. UPDATE emp SET salary = 5000;
d. None of the above.
ANSWER
a. UPDATE emp SET sal = salary + 5000;
103. What is the purpose of the SQL query: “SELECT * FROM
Stud ORDER BY Rollno ASC;”?
a. Display all record in ascending order followed by Rollno
b. To display all the records of the table.
c. Both of the above.
d. None of the above.
ANSWER
a. Display all record in ascending order followed by Rollno
104. What does DML stand for?
a. Database Manipulation Language
b. Data Modification Language
c. Data Manipulation Language
d. None of the above
ANSWER
a. Data Manipulation Language
105. What does SQL stand for?
a. Structured Query Language
b. Structured Quality Language
c. Structural Query Language
d. None of the above
ANSWER
b. Structured Query Language
106. Which language is used to extract/fetch data from a table?
a. HTML
b. MySQL
c. OOBase
d. Python
ANSWER
b. MySQL
107. In Base, how can data be linked between two or more
tables?
a. Foreign key
b. Primary key
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
108. In which view can the structure of a table be changed?
a. Design view
b. Structure view
c. Data view
d. All of the above
ANSWER
a. Design view
109. What data type is the Auto Value property used for?
a. Date
b. Character
c. Numeric
d. Binary
ANSWER
c. Numeric
110. Which data type is appropriate for storing information
such as salary, fees, and price?
a. Binary data type
b. Alphanumeric data type
c. Date Time
d. Numerical data type
ANSWER
d. Numerical data type
111. In what ways can a table be created?
a. Using a Wizard
b. Using design view
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
112. What kind of field is a primary key?
a. Duplicate Data
b. Unique Data
c. Any Data
d. None of the above
ANSWER
b. Unique Data
113. Does data integrity mean that data is accurate and
consistent in the database?
a. Yes
b. No
ANSWER
a. Yes
114. Which of the following is not a database program?
a. MySQL
b. Writer
c. Oracle
d. OpenOffice base
ANSWER
b. Writer
115. What is a database?
a. A collection of attributes
b. A collection of field
c. An organized collection of data
d. None of the above
ANSWER
c. An organized collection of data
116. Which field in the “Student” table can act as the primary
key?
a. Roll_No
b. Fee
c. Student_name
d. Marks
ANSWER
a. Roll_No
117. Is Open Office base an open source software?
a. True
b. False
ANSWER
b. False
118. What is the default name of a table?
a. 1 Table
b. Table 1
c. Untitled 1
d. Tab 1
ANSWER
b. Table 1
119. Which of the following data types will occupy more space
in computer memory?
a. Bigint
b. Smallint
c. Tinyint
d. Integer
ANSWER
a. Bigint
120. In which view can data be entered in a table?
a. Data view
b. Datasheet view
c. Both a) and b)
d. None of the above
ANSWER
b. Datasheet view
121. Can relationships be created between _________ tables in
Base?
a. One table only
b. Two or more tables
c. Both a) and b)
d. None of the above
ANSWER
b. Two or more tables
122. Are queries commands that are used to define the
structure and modify the data in a table?
a. True
b. False
ANSWER
a. True
123. Which SQL query will retrieve the details of all students
whose favorite color is blue?
a. SELECT all FROM Stud WHERE fav_Color = ‘Blue’;
b. SELECT all FROM Stud WHERE fav_Color is ‘Blue’;
c. SELECT name FROM Stud WHERE fav_Color = ‘Blue’;
d. SELECT * FROM Stud WHERE fav_Color = ‘Blue’;
ANSWER
d. SELECT * FROM Stud WHERE fav_Color = ‘Blue’;
124. By default, data is arranged in _____ order using the ORDER
BY clause.
a. Descending
b. Ascending
c. Both a) and b)
d. None of the above.
ANSWER
b. Ascending.
125. Which of the following is NOT a SQL command?
a. DELETE
b. UPDATE
c. SELECT
d. CREATE
ANSWER
d. CREATE
126. What is a foreign key?
a. A key that can contain null values
b. A key that can contain Zero
c. A key that references another table’s primary key
d. A key that uniquely identifies in table
ANSWER
c. A key that references another table’s primary key
127. Which of the following field properties is for the Numeric
data type in Base?
a. Default Value
b. AutoValue
c. Length
d. All of the above
ANSWER
d. All of the above
128. What is the default length of the Integer data type in Base?
a. 20
b. 40
c. 10
d. 50
ANSWER
c. 10
129. We can create a relationship between any two tables by
selecting which option from the which menu?
a. Relationships
b. Filter
c. Sort
d. All of the above
ANSWER
a. Relationships
130. In which relationship, both the tables must have primary
key columns?
a. One to Many
b. One to One
c. Many to Many
d. Many to All
ANSWER
b. One to One
131. What are the commands that define the data structure and
manipulate the data in a database?
a. Reports
b. Queries
c. Forms
d. Tables
ANSWER
b. Queries
132. Which operators are used to perform simple calculations
in Base?
a. Arithmetic Operators
b. Membership Operators
c. Logical Operators
d. Relational Operators
ANSWER
a. Arithmetic Operators
133. Can ‘Where’ and ‘Order by’ clauses be used together in a
single query?
a. True
b. False
ANSWER
a. True
134. What is the purpose of the Update command in a
database?
a. It is used to modify the data of the table.
b. It is used to delete the table.
c. It is used to modify the structure of the table.
d. It is used to insert data in the table.
ANSWER
a. It is used to modify the data of the table.
135. Which statement is used to remove one or more records
from a database?
a. Erase
b. Delete
c. Remove
d. Del
ANSWER
b. Delete
136. Can we insert records into a table using a form in a
database?
a. True
b. False
ANSWER
a. True
137. Which method is used to create a table step by step?
a. Use Wizard to Create Table
b. Create View
c. Create table in Design View
d. None of the above
ANSWER
a. Use Wizard to Create Table
138. Which of the following is not a Date Time data type?
a. Date
b. Stamptime
c. Time
d. Timestamp
ANSWER
b. Stamptime
139. Binary data types are used for storing data in
_________________ formats.
a. image
b. sound
c. boolean
d. binary
ANSWER
d. binary
140. Which of the following is not a category of Open Office data
types?
a. Alphanumeric Types
b. Date time
c. Numeric Types
d. Bool Type
ANSWER
d. Bool Type
141. Which feature helps us get summarized data in a
database?
a. Form
b. Query
c. Report
d. Table
ANSWER
c. Report
142. Which database feature helps users to systematically store
information in a table?
a. Table
b. Report
c. Form
d. Query
ANSWER
c. Form
143. Rajesh wants to display the salary of all the employees
after incrementing it by twice the amount of the present salary.
Which query will help her achieve this task?
a. Select salary + 2 from employee;
b. Select salary / 2 from employee;
c. Select salary – 2 from employee;
d. Select salary * 2 from employee;
ANSWER
d. Select salary * 2 from employee;
144. Which feature is used to collect specific information from
the pool of data?
a. Form
b. Query
c. Table
d. Report
ANSWER
b. Query
145. Which of the following relationships cannot be created in
Open Office Base?
a. One to Many
b. Many to Many
c. One to One
d. Many to All
ANSWER
d. Many to All
146. Which property helps to set the value that is automatically
inserted in a field when a new record is created?
a. Length
b. Entry Required
c. Format
d. Default Value
ANSWER
d. Default Value
147. Which field property in Base can be used to automatically
increment the value of a field?
a. Format
b. Length
c. Auto Value
d. Default Value
ANSWER
c. Auto Value
148. In which view can data be entered in a table in Base?
a. Datasheet View
b. Design View
c. Both of the above
d. None of the above
ANSWER
a. Datasheet View
149. Which of the following is NOT a component of a database
management system?
a. Data warehouse
b. Query language
c. Data dictionary
d. Database engine
ANSWER
a. Data warehouse
150. Which of the following is NOT a join type in SQL?
a. Outer join
b. Full join
c. Inner join
d. Circular join
ANSWER
d. Circular join
151. Which element in a table contains data of the same data
type?
a. Column
b. Tuple
c. Record
d. All of the above
ANSWER
a. Column
152. A table has a fixed number of ________ but can have any
number of ________
a. tuple, columns
b. columns, rows
c. rows, columns
d. tuple, degree
ANSWER
b. columns, rows
153. Which of the following acts as an interface to view, enter
and change data in a database?
a. Report
b. Form
c. Table
d. Query
ANSWER
⟶” swaptitle=”Hide Answer ⟵”] b. Form.
154. Which SQL command is used to delete data from a table?
a. INSERT
b. REMOVE
c. SELECT
d. DELETE
ANSWER
d. DELETE
155. Which is the most common DML command?
a. Delete
b. Select
c. Update
d. All of the above
ANSWER
b. Select
156. Which software is appropriate for storing data about
school students?
a. Calc
b. MS-Access
c. Writer
d. Impress
ANSWER
b. MS-Access
157. What kind of data storage system stores data in a single
table?
a. Only File
b. Relational
c. One File
d. Flat File
ANSWER
d. Flat File
158. What kind of computer holds the actual databases and
runs only DBMS and related software?
a. Database Server
b. Web Server
c. SMPT Server
d. POP Server
ANSWER
a. Database Server
159. What is the role of the database server in relation to the
GUI?
a. Back End
b. Front End
c. Both a) and b)
d. None of the above
ANSWER
a. Back End
160. What is duplication of data called?
a. Redundancy
b. Consistency
c. Foreign Key
d. Inconsistency
ANSWER
b. Redundancy
161. Which of the following is not an advantage of a database?
a. Increasing Data Inconsistency
b. Increasing Data Redundancy
c. Data Security
d. Sharing of Data
ANSWER
a. Increasing Data Inconsistency
162. Can a database have only one table?
a. Yes
b. No
ANSWER
b. No
163. Which of the following is used to maintain unique records
in a table?
a. Composite Key
b. Primary Key
c. Alternate Key
d. Foreign Key
ANSWER
b. Primary Key
164. What is a primary key made up of two or more columns
called?
a. Composite Primary Key
b. Alternate Primary Key
c. Foreign Primary Key
d. Reference Primary Key
ANSWER
a. Composite Primary Key
165. Can duplicate values be entered in a primary key?
a. Yes
b. No
ANSWER
b. No
166. What is a key that refers to the primary key of another
table called?
a. Alternate Primary Key
b. Foreign Key
c. Primary Key
d. Alternate Key
ANSWER
b. Foreign Key
167. What kind of database software is required when data is
stored, maintained, and retrieved from multiple tables?
a. SpreadSheet
b. RDBMS
c. DBMS
d. All of the above
ANSWER
b. RDBMS
168. Does every row in a table have the same structure?
a. True
b. False
ANSWER
a. True
169. What are the basic building blocks of a database?
a. Records
b. Tables
c. Fields
d. All of the above
ANSWER
b. Tables
170. What is the default data type of fields?
a. Int
b. Text[Memo]
c. Memo
d. Text[Varchar]
ANSWER
d. Text[Varchar]
171. Does Base automatically add a column as Primary Key if
none is added?
a. True
b. False
ANSWER
a. True
172. What is the default length of the Varchar data type?
a. 10
b. 30
c. 50
d. 20
ANSWER
c. 50
173. What is used to identify the type of data that will be stored
in a database?
a. Field
b. Data type
c. Table
d. Record
ANSWER
b. Data type
174. Which of the following is not a numerical data type?
a. Varchar
b. Tinyint
c. Boolean
d. Smallint
ANSWER
a. Varchar
175. Which of the following data types cannot store decimal
values?
a. Boolean
b. Decimal
c. Numeric
d. Real
ANSWER
a. Boolean
176. Which data type is used for storing photos, music files, and
other binary data?
a. Numeric
b. Varchar
c. Binary
d. Alphanumeric
ANSWER
c. Binary
177. Is Char a fixed-length data type and Varchar a variable-
length data type?
a. Yes
b. No
ANSWER
a. Yes
178. What operations can be performed on data in a table?
a. Insert
b. Delete
c. Modify
d. All of the above
ANSWER
d. All of the above
179. After inserting records in a table, can the structure of the
table be modified?
a. True
b. False
ANSWER
b. False
180. What does sorting mean?
a. Arranging data in decreasing order
b. Arranging data in increasing order
c. Both a) and b)
d. None of the above
ANSWER
c. Both a) and b)
181. Is Referential Integrity used to maintain accuracy and
consistency of data in a relationship?
a. True
b. False
ANSWER
a. True
182. From which menu a relationship can be created in Base?
a. View
b. Tools
c. Insert
d. Windows
ANSWER
b. Tools
183. How many types of relationships can be created between
tables in Base?
a. Four
b. Five
c. Three
d. Two
ANSWER
c. Three
184. In Open Office Base, in which view can a query be created?
a. Using wizard
b. Design view
c. Both a) and b)
d. None of the above
ANSWER
c. Both of the above
185. Can data be deleted using queries in Base?
a. True
b. False
ANSWER
b. False
186. Which statement is used to retrieve data from a table?
a. Print
b. Select
c. Delete
d. Update
ANSWER
b. Select
187. What is the purpose of the SQL query: “SELECT empname,
salary * 3 FROM emp;”?
a. Display only name and salary
b. It will give an error.
c. Display empname and three times of the salary of all employees.
d. None of the above.
ANSWER
c. Display empname and three times of the salary of all employees.
188. Which SQL command is used to modify data in a table?
a. SELECT
b. MODIFY
c. DELETE
d. UPDATE
ANSWER
d. UPDATE
189. Which of the following SQL commands are considered as
DML commands?
a. UPDATE
b. DELETE
c. INSERT
d. All of the above.
ANSWER
d. All of the above.
190. What is another name for a tuple in a table?
a. Record
b. Column
c. Both of the above
d. Attribute
ANSWER
a. Record
191. Which element in a table represents a single data item?
a. Rows
b. Attribute
c. Columns
d. Field
ANSWER
c. Columns
192. Which of the following is NOT a standard SQL data type?
a. Float
b. Boolean
c. Integer
d. String
ANSWER
b. Boolean
193. Which of the following is NOT a function of a database
management system?
a. Data retrieval
b. Data manipulation
c. Data storage
d. Data transmission
ANSWER
d. Data transmission
194. Which of the following is NOT a type of data manipulation
language (DML)?
a. SELECT
b. UPDATE
c. INSERT
d. DELETE
ANSWER
a. SELECT
195. What can you do with data in a table created in Base?
a. Modify it
b. Insert it
c. Delete it
d. All of the above
ANSWER
d. All of the above
196. In which view can the structure of a table be changed in
Base?
a. Design View
b. Datasheet View
c. Both of the above
d. None of the above
ANSWER
a. Design View
197. Which field property in Base can be used to store data in a
specific format, such as a phone number?
a. Auto Value
b. Length
c. Default Value
d. Format
ANSWER
d. Format
198. What is the default value of the field property ‘Entry
Required’ in Base?
a. Yes
b. No
ANSWER
b. No
199. To arrange the data in ascending or descending order, first
select the column(s) and then click on which button?
a. View
b. Save
c. Arrange
d. Sort
ANSWER
d. Sort
200. When a primary key from one table appears in another
table, it is called a _______ _.
a. Composite Primary Key
b. Secondary Key
c. Foreign Key
d. Main Key
ANSWER
c. Foreign Key
201. In which relationship, one of the table must have primary
key column?
a. One to Many
b. One to One
c. Many to Many
d. Many to All
ANSWER
a. One to Many
202. Once the relationships applied on the tables cannot be
removed.
a. True
b. False
ANSWER
b. False
202. To remove the relationship between tables, right-click on
the relationship thread and select which option?
a. Delete
b. Remove
c. Edit
d. Clear
ANSWER
a. Delete
203. Which language is used to write a query in Open Office
Base?
a. VB
b. SQL
c. C
d. Python
ANSWER
b. SQL
204. Which command is used to retrieve data from a table?
a. Delete
b. Create
c. Select
d. Insert
ANSWER
c. Select
205. Can SELECT statement retrieve data from multiple tables?
a. True
b. False
ANSWER
a. True
206. Rajesh wants to display all the records from the table
‘student’.
a. Select * student;
b. Select # from student;
c. Select from student;
d. Select * from student;
ANSWER
d. Select * from student;
207. Which clause can be used with the SELECT SQL command
to display records containing the same type of values?
a. Order By
b. Where
c. Both a and b
d. None of the above
ANSWER
b. Where
208. Which commands are used to add, modify, and delete
records in a database table?
a. Insert, Update, and Remove
b. Insert, Update, and Delete
c. Insert, Modify, and Delete
d. Add, Update, and Delete
ANSWER
b. Insert, Update, and Delete
209. By default, in which order is data arranged using the
ORDER BY clause in a database?
a. Decreasing
b. Alphabetical
c. Increasing
d. Descending
ANSWER
c. Increasing
210. Which clause of the SELECT statement helps to display
specific data in a database?
a. Where
b. Between
c. Order By
d. None of the above
ANSWER
a. Where
211. What is the name of the interface in a user-specified layout
that lets users view, enter, and change data directly in database
objects such as tables?
a. Query
b. Form
c. Report
d. Table
ANSWER
b. Form
212. Aman created an object ‘X’ in Base to store the value in the
form of rows and columns. What is ‘X’?
a. Table
b. Row
c. Column
d. Database
ANSWER
a. Table
213. Which of the following contains data of the same data
type?
a. Record
b. Tuple
c. Column
d. All of the above
ANSWER
c. Column
214. Give an example of an open-source RDBMS.
a. Microsoft SQL Server
b. Microsoft Access
c. Oracle
d. OpenOffice Base
ANSWER
d. OpenOffice Base
215. What is the default length of the TINYINT data type?
a. 1
b. 2
c. 3
d. 4
ANSWER
c. 3
216. Which data type can store character/data up to the length
specified by the user?
a. Varchar
b. Char
c. Varchar_IgnoreCase
d. All of the above
ANSWER
d. All of the above
217. Dhriti wants to store the details of students as well as their
pictures in a table named “school”. Which data type is suitable
for storing pictures?
a. Boolean
b. Binary
c. Memo
d. Varchar
ANSWER
b. Binary
218. Which data type stores hours, minutes, and second
information?
a. Date
b. Time
c. Stamptime
d. Timer
ANSWER
b. Time

NOTES OF LESSON
What is Database?
An organised group of data that is kept and accessible
electronically is referred to as a database. It is a digital
repository that enables the effective management, storage, and
retrieval of both organised and unorganised data. Information like
client records, financial data, inventory listings, and much more can
be stored in databases. Example of database are – Microsoft Access,
OpenOffice Base, Oracle, MySQL and PostgreSQL etc.
What is a Database Management System?
Data is stored, retrieved, and analyzed using software called
database management systems (DBMS). Users can create, read,
update, and remove data in databases using a Database
Management System, which acts as an interface between them and
the databases. Example of database Management System are –
Microsoft Access, OpenOffice Base, Oracle, MySQL and
PostgreSQL etc.
Data can be organized into two types:
• Flat File: Data is stored in a single table. Usually suitable for
less amount of data. basically for small-scale organization
where data does not need to be strucutred in a complex
way. Example of database software are Microsoft Excel or
Google Sheets.
• Relational: Data is stored in multiple tables and the tables are
linked using a common field. Relational is suitable for medium
to large amount of data. Example of database software are
MySQL, Microsoft SQL Server, and Oracle Database..
What is Database Server?
Database servers are dedicated computers that are designed to
store data and provide database services to other
computers. We use a database to store, organize, manage and
retrieve data efficiently and effectively. The database servers run
only database and database related software.
Advantages of Database
Reduces Data Redundancy
Data redundancy means when same data is stored more than one
places, which increased complexity and wasted of storage space, so,
database helps to reduce data redundacy.
Sharing of Data
A database allows its users to exchange data among themselves.
The data can only be shared with users who have received the
appropriate degrees of authorization because there are different
levels of access to the data.
Data Integrity
Data integrity refers to the accuracy and consistency of data
stored in a database management system (DBMS). Database
ensures that the data is reliable and can be trusted for decision
making and other critical business processes.
Data Security
A database’s concept of data security is important. The database
should only be accessible to authorised users, whose identities
must be verified using a username and password.
Privacy
The privacy rule in a database ensures that only authorized users
can access the database and view data according to the specific
privacy constraints. To maintain data security, access levels are set
in the database so that a user can only view data that they are not
allowed to modify if the permission is not given.
For example, in social networking sites, different accounts have
different access constraints, and users are only allowed to view the
other account data that is permitted for their specific account.
Backup and Recovery
Database Management System automaticlly take backup and
recovery processes to ensure the protection and availability of data.
This means that the DBMS automatically creates and manages
backups of the database at regular intervals, and also provides
tools to recover data in the event of a failure or data loss.
Data Consistency
Data consistency refers to the accuracy and reliability of data stored
in a database or other data storage system. It means that the data is
consistent and valid across all instances where it is stored or
accessed.
For example, if a customer’s name and address are stored in
multiple tables within a database, the data must be consistent across
all table.
Features of Database
There are some key features of a database:
1. One or more tables can be added in the database.
2. Decreased storage costs and space requirements
3. Users can use query languages in a database.
4. Multiple users can access the data from the database .
5. Unique keys aid in preventing errors caused by human or
technological mishaps.
Primary Key, Composite Primary Key and Foreign Key in a
Database
In the RDBMS data can be integrated using keys. These are Primary
Key, Composite Primary Key, and Foreign Key, Key are used to make
the relationship between the tables.
1. Primary Key – This unique field is called the Primary Key
(PK). primary key is a field or a set of fields that uniquely
identify each record in a table. A primary key must be unique
and cannot contain null values.
2. Composite Primary Key – A composite primary key is a
primary key that consists of two or more fields that together
uniquely identify each record in a table.
3. Foreign Key – A composite primary key is a primary key that
consists of two or more fields that together uniquely identify
each record in a table.
What is RDBMS?
A database management system that is based on the relational
model is called an RDBMS (Relation Database Management System).
Tables are used to organise data in relational databases. A relational
database management system (RDBMS) is used to store, manage,
query, and retrieve data.
Database Objects
a. Tables: Data is arranged into rows and columns in a table,
which is a type of data structure. It can be applied to both the
storage and presentation of structured data.
b. Columns or Fields or Attributes: Data is arranged vertically
from top to bottom in columns. Each row of the table has one
column, which is a collection of data values of a specific basic
type. The structure by which the rows are put together is
provided by the columns.
c. Rows or Records or Tuples: A row, also known as a Record or
Tuple, in a table represents a single data item. A database table
can be represented graphically as being made up of rows and
columns, or fields. Every row in a table has the same structure
and represents a group of connected data.
Difference between DBMS and RDBMS
Aspect DBMS RDBMS
Data is stored in various
Data is stored in tables that
formats such as flat files
Data structure or hierarchical are related to each other
using a relational model.
structures.
DBMS systems may or RDBMS systems enforce
Data integrity may not enforce strict strict data integrity rules that
data integrity rules. ensure data consistency and
Aspect DBMS RDBMS
accuracy.

RDBMS systems follow


DBMS systems may or
Data normalization rules to
may not follow
normalization minimize data redundancy
normalization rules. and improve data integrity.
Typically, DBMS systems RDBMS systems use
Query
use proprietary query standard query language like
language languages. SQL.
DBMS systems may not RDBMS systems are highly
Scalability be scalable to handle scalable to handle large
large amounts of data. amounts of data.
DBMS systems are RDBMS systems are
Cost generally less expensive generally more expensive
than RDBMS systems. than DBMS systems.
How to create a database using Open Office
• Step 1 : Click on Start > Programs > OpenOffice > OpenOffice
Base
• Step 2 : Click on Create a new database
• Step 3 : In the Database Wizard, Click on Finish
• Step 4 : Specify a the Name of database and click on Save
How to create a table in Database
The database’s tables are used to store data. In the database, In
OpenOffice Base the tables can be created in two different ways.
1. Create Table in Design View
2. Use Wizard to Create Table
Create Table in Design View
• Step 1 : Click on Create Table in Design View
• Step 2 : Select Field name and suitable datatype
• Step 3 : Set the Primary Key
• Step 4 : Change the table name
• Step 5 : Save the table
Use Wizard to Create Table
• Step 1 : Click on Table > Use Wizard to Create table
• Step 2 : Click the Select Fields > Choose Category > Select the
table > Click on Next Button
• Step 3 : Select data types from the given field
• Step 4 : Set the Primary Key
• Step 5 : Rename the table and Click on Finish
Data Types
The type of data (value) that will be stored in the database is defined
by its datatype. Important to know the different types of data helps
to ensure that each property’s value is as expected and that data is
collected in the correct format.
Data types in OpenOffice base are broadly classified into five
categories listed below.
• Numeric Types
• Alphanumeric Types
• Binary Types
• Date time
• Other Variable types
Numeric Types
Numerical data types are data types that store numeric values in a
database. Numeric data types can be further divided into several
subtypes, including:
Alphanumeric Types
Data that has both letters and numbers is referred to as
alphanumeric type.

Binary Types
For storing data in binary formats, binary data types are utilised. In
a database, binary data types can be used to store things like music
and image files. The binary data type can generally be used to store
files in any format.
Date Time
When specifying date and time values for a column used in a
database table, date time data types are used. Information like dates
of birth, admissions, product sales, and other dates can be stored in
databases using date and time data types.
Perform Operations on Table
In Base, data is kept in tables that may be added to, changed, or
deleted by using the proper options.
Insert Data in the Table
• Step 1 : Select the table > Double click on it
• Step 2 : The table will open in Datasheet View
• Step 3 : Now you can Insert Number of records in Datasheet
View
Editing Records in the Table
• Step 1 : Select the table > Double click on it.
• Step 2 : The table will open in Datasheet View
• Step 3 : Edit the record as per the requirement
Deleting Record From the Table
• Step 1 : Select the table > Double click on it.
• Step 2 : The table will open in Datasheet View
• Step 3 : Right click on data and select delete option
Field Properties
To modify the field’s attributes It is necessary to modify the table
structure in design view. The following actions will be taken to set
the field’s properties:
Select the table > Right click > Select the option Edit > the table
Design View window will open
Following are some properties of data of the numeric type:
1. AutoValue – if set to yes then field will get the auto numeric
values.
2. Length – By default length of the field is 10 but the size of the
field can be set to maximum length.
3. Default Value – A default value can be set for a field if user
don’t provide any value while entering the values in the table.
4. Format example – This property helps to set the format of the
data entered in the field such as 91-222-333.
Following are some properties of data of the character type:
1. Entry Required – if set to yes then it will be must to insert the
value in the field which means that field cannot be left blank.
2. Length – By default length of the field is 10 but the size of the
field can be set to maximum length.
3. Default Value – A default value can be set for a field if user
don’t provide any value while entering the values in the table.
4. Format example – This property helps to set the format of the
data entered in the field such as 91-222-333.
Sorting Data
Sorting means to arrange the data in either ascending order of
descending order. Sorting is the process of putting data into a
meaningful order so you can evaluate it more efficiently.
Referential Integrity
The relationship between tables is referred to as referential
integrity. Referential integrity is used to maintain accuracy and
consistency of data in a relationship. In Base, data can be linked
between two or more tables with the help of primary key and
foreign key constraints.
Referential integrity helps to avoid:
1. Adding records to a related table if there is no associated record
available in the primary key table.
2. Changing values in a primary if any dependent records are
present in associated table(s).
3. Deleting records from a primary key table if there are any
matching related records available in associated table(s).
Creating and Editing Relationships between Tables
An association or link between two or more tables is referred to as a
relationship. You don’t have to enter the same data again in different
tables when you relate two tables.
Relationships between tables helps to
1. Save time as there is no need to enter the same data in
separate tables.
2. Reduce data-entry errors.
3. Summarize data from related tables.
Type of Relationships in Database
There are three types of relationships which can be created in
tables:
1. ONE to ONE
2. ONE to MANY OR MANY to ONE
3. MANY to MANY
ONE to ONE
In this relationship, both the tables must have primary key columns.
ONE to MANY OR MANY to ONE
In this relationship, one of the table must have primary key column.
It signifies that one column of primary key table is associated with
all the columns of associated table.
MANY to MANY
In this relationship, no table has the primary key column. It signifies
that all the columns of primary key table are associated with all the
columns of associated table.
Note Removing the Relationships – With the use of the Delete
option, the relationships that have been applied to the tables can
also be deleted. When you right-click a relationship thread, the
Delete option will appear.
Retrieve Data using Query
In order to describe the data structure and to modify the data in the
database, queries are used as instructions. A query enables the
joining and filtering of data from various tables.
Database Languages having two type:
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
DDL Statements:
• Create: Using this statement, a database or set of tables can be
created.
• Alternate: This statement is used to change the table’s
structure.
• Drop: This statement is used to remove database objects from
the system.
DML statements:
• SELECT: The statement “SELECT” is used to get data from the
database.
• INSERT: The statement “INSERT” is used to add a new record
to the database.
• DELETE: The database can be cleaned out by using the
statement DELETE.
• UPDATE: This statement is used to modify the database’s
information.
Database Query
Query is a computer languages. In order to describe the data
structure and to modify the data in the database, queries are used as
instructions. Query can extract particular data from a database. We
can filter and join data from various tables with the help of a query.
By using the criteria you supply query will filter the data.
Select Statement
A select query is a language in a database that displays data in
Datasheet view. Data from tables is displayed by a query rather than
being stored by it. A query may display data from one or more
tables, from other queries, or from both of these sources
simultaneously.
The SELECT statement has many optional clauses:
• WHERE specifies which rows to retrieve.
• ORDER BY specifies an order in which to return the rows.
Syntax of Select Statement is –
SELECT * FROM <TABLENAME>;
Query related to Simple Select Statement –
Table Name – product
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Question – Write a Query to display all record from the table;

Select * from product;


Output –
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Question – Write a Query to display product name from the table;
Select Product_Name from product;
Output –
Product_Name
Soap
Powder
Shampoo
Soap Box
Question – Write a Query to display Product_Name and Price from
the table;
Select Product_Name, Price from product;
Output –
Product_Name Price

Soap 40

Powder 80

Shampoo 300

Soap Box 120

Query related to Select Statement with Mathematical function –


Table Name – product
Product_No Product_Name Price Quantity

25 Soap 40 80

31 Powder 80 30

45 Shampoo 250 25

52 Soap Box 120 100


Question – Write a Query to find the total no of quantity available in
table;
Select sum(quantity) from product;
Output – 235
Question – Display the total amount of each item. The amount must
be calculated as the price multiplied by quantity for each item.
Select Product_No, Product_Name, Price * Quantity from product;
Output –
Product_No Product_Name Price*Quantity
25 Soap 3200
31 Powder 2400
45 Shampoo 6250
52 Soap Box 12000
Question – Write a query to find the average price of the total
product;
Select avg(Quantity) from product;
Output – 58.75
Query related to Select Statement with Where clause

Product_No Product_Name Price Quantity


25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Table Name – product
Question – Write a Query to display the product whose price is less
than 90
Select * from product where price < 90;

Product_No Product_Nam Price Quantity

25 Soap 40 80

31 Powder 80 30
Question – Write a Query to find the total amount of the Shampoo
product;
Select Price*Quantity from product where Product_Name =
‘Shampoo’;
Output – 6250
Or
Select Product_No, Product_Name, Price*Quantity from product
where Product_Name = 'Shampoo';
Output –
Product_No Product_Nam Price*Quantity
45 Shampoo 6250
Question – Write a Query to display the data whose quantity is
equal to 80.
Select * from product where quantity = 80;
Output –
Product_No Product_Nam Price Quantity

25 Soap 40 80

Question – Write a Query to display a list of Products whose Price


between 40 to 120.
Select * from product where Price >= 40 and Price <= 120;
Output –
Product_No Product_Nam Price Quantity
25 Soap 40 80
31 Powder 80 30
52 Soap Box 120 100
Query related to Select Statement with Order by
Table Name – product
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Question – Write a Query to display the list of Product_Name in
alphabetical order.
Select * from product order by Product_Name ASC;
Or
Select * from product order by Product_Name;
Output –
Product_No Product_Nam Price Quantity
31 Powder 80 30
45 Shampoo 250 25
25 Soap 40 80
52 Soap Box 120 100

Question – Write a Query to display the list of Price in ascending


order.
Select * from product order by Price ASC;
Or
Select * from product order by Price;
Output –
Product_No Product_Nam Price Quantity
25 Soap 40 80
31 Powder 80 30
52 Soap Box 120 100
45 Shampoo 250 25
Question – Write a Query to display the list of Price in descending
order.
Select * from product order by Price DESC;
Output –
Product_No Product_Nam Price Quantity
45 Shampoo 250 25
52 Soap Box 120 100
31 Powder 80 30
25 Soap 40 80
UPDATE statement
To edit or update already-existing records in a table, use the
UPDATE statement. Using the WHERE clause, you can either define a
specific subset of entries to edit or use it to update everything at
once.
Syntax of Update Statement –
UPDATE <table name> SET = value [, column_name = value ...]
[WHERE ];
Table Name – product
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100

Question – Write a Query to update the price of Shampoo in the


product table.
Update product Set Price = 300 where Price = 250;
Output –
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 300 25
52 Soap Box 120 100
Question – Write a Query to update the Quantity of Powder in the
product table.
Update product Set Quantity = 50 where Product_Name = ‘Powder’;
Output –
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 50
45 Shampoo 250 25
52 Soap Box 120 100
Create Table
To create a new table in the database you can use Create Table
Command.
Syntax of Create Table –
CREATE TABLE table_name ( column1 datatype, column2
datatype, column3 datatype);
Question – Write a Query to create the following table in the
database;
Table Name – product
Field DataType
Product_No Integer
Product_Name Varchar(20)
Price Integer
Quantity Integer
Create table product ( Product_No Int, Product_Name Varchar(20),
Price Int, Quantity Int);
Output –
Product_No Product_Name Price Quantity
Insert Table
Insert statement is primarily used to add a single or more rows to
the target table.
Syntax of Insert Table –
INSERT INTO table_name (column1, column2, column3, ...) VALUES
(value1, value2, value3, ...);
Or
INSERT INTO table_name VALUES (value1, value2, value3, ...);
Table Name – product
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 250 25
52 Soap Box 120 100
Question – Write a Query to add a new row with the following details
(72, “Hair Conditioner‟, 350, 60)
Insert into product (Product_No, Product_Name, Price, Quantity)
values(72, “Hair Conditioner‟, 350, 60);
Or
Insert into product values(72, “Hair Conditioner‟, 350, 60);
Output –
Product_No Product_Name Price Quantity
25 Soap 40 80
31 Powder 80 30
45 Shampoo 300 25
52 Soap Box 120 100
72 Hair Conditioner 350 60
Create Forms and Reports using Wizard
Forms
The Form allows you greater control over your outcomes. The form
allows you to customize various parts of the form’s design and then
generates a form based on your instructions.
Steps To Create Form Using Wizard
• Step 1 : Click Use Wizard to Create Form
• Step 2 : Select the selective Fields using Arrow button
• Step 3 : Click Next
• Step 4 : Add Subform if you need to insert
• Step 5 : Click Next
• Step 6 : Arrange selected field in a form
• Step 7 : Click Next
• Step 8 : Click Finish
Reports
A report helps in the presentation of data in a summarized format. It
is utilized to create a clear format for the entire work product. In the
database, you can build reports.
Steps To Create Report Using Wizard
• Step 1 : Click on Use Wizard to Create Report
• Step 2 : Select the selective Fields using Arrow button
• Step 3 : Click Next
• Step 4 : Redefine the label of the fields in the reports or else
you can set the default name
• Step 5 : You can define grouping for the fields of the table
• Step 6 : Click on Next
• Step 7 : Click Finish

QUESTION AND ANSWER


1. What is a database?
Answer – A database is an organized collection of data. Databases
can store, retrieve and manage large amounts of data. The database
stores the information in the form of a table.
2. What is the purpose of a Database Management System?
Answer – A database management system (DBMS) is a software
package which manages and maintains data in a database. A DBMS
enables several user application programs to access the same
database at the same time. It enables organizations to easily create
databases for a variety of purposes. A database is a comprehensive
collection of data records, files, and other items.
3. How is data organized in a database?
Answer – There are two way to organized data in database –
a. Flat File – It stores the data in a single table and it is suitable for
small amounts of data.
b. Relational – It stores the data in a multiple table and all the
tables are connected to each other using a common field with the
help of relationships.
4. What do you mean by Database Servers?
Answer – Database servers are powerful computers that store and
manage data on a server. This type of server is dedicated to a single
purpose and helps to hold the database and run only DBMS and
related software.
5. Give the Advantages of database?
Answer – Advantages of database are –
a. Reduce Data Redundancy – When the same data set is stored in
two or more locations, this is referred to as data redundancy. As a
result, this helps in the protection of duplicate data in a database.
b. Sharing of Data – Databases can share the data with multiple
users at a time. There are multiple levels of authorization to access
the data, and as a result, the data can only be shared with those who
are permitted.
c. Data Integrity – The term “data integrity” refers to the accuracy
and consistency of the data in the database. Data integrity also
refers to data safety.
d. Data Security – You know that data is very important, databases
give privileges to authorized users and allow them to access the
database using username and password.
e. Privacy – A database’s privacy rule says that only authorized
users are permitted to access the database in accordance with its
privacy constraints. For example – if you log in your Gmail account
then you will see your email only, you will not see any other account
email.
f. Backup and Recovery – Backup and recovery are handled
automatically by the Database Management System.
g. Data Consistency – Data consistency ensures the modification in
the data will be the same for all the users who are accessing the
database. For example if you have registered a train ticket from
IRCTC website then whatever changes are there it will be the same
for all the users who are trying to reserve the ticket.
6. What are the key features of a database?
Answer – Some of the key features of database are –
a. Multiple table can be store in a single database
b. Database can share the data to multiple users
c. Database can create backups automatically
d. Database save storage space
e. Large amount of data can be managed by database
f. Each table in a database contains separate information
g. Provides high level security
7. What is RDBMS?
Answer – RDBMS stands for Relational Database Management
System is an upgraded version of DBMS, RDBMS stores the data in
the form of a table. In RDBMS multiple tables can be linked together,
and support multiple users to access the database.
8. What different types of keys are available in RDBMS?
Answer – The different keys available in RDBMS are –
a. Primary Key (PK) – A primary key is a unique value that
identifies a row in a table. If the primary key is defined to any table
column it means the duplication will be not allowed.
b. Composite Primary Key – When a primary key is applied to one
or more columns in the same table is known as Composite Primary
Key.
c. Foreign Key (FK) – By default columns are foreign key, foreign
key points to the primary key of another table.
9. What are the different database objects?
Answer –
a. Table – A table is a collection of data components structured in
the form of vertical columns and horizontal rows.
b. Columns / Fields / Attributes – Columns or Fields or Attributes
all are the same, A column is a collection of data values of a single
data type, one for each row in a table. It is also known as the heading
of the column.
c. Rows / Records / Tuples – A row, also known as a Record or
Tuple, is a single data item in a table. A database table can be
represented as a series of rows and columns or fields. Each row in a
table represents a set of related data, and each row has the same
structure.
10. What are data types?
Answer – Datatypes are used to define the type of data that will be
stored in the database. Data types in the OpenOffice base are
classified into five types.
a. Numeric Types – Numeric data types are used to describe
numerical values for fields in a database table. Numeric data types
used for numbers and decimals.
Some of the important numeric data types are –
a. Boolean
b. Integer
c. Numeric
d. Decimal
e. Float
f. double
b. Alphanumeric Types – Alphanumeric data types are used to
describe character values for fields in a database.
Some of the important alphanumeric data types are –
a. Longvarchar
b. Char
c. Varchar
d. Varchar_ignorecase
c. Binary Types – For storing data in binary formats, binary data
types are used. Binary data types in a database can be used to store
images, music files, and so on.
Some of the important Binary data types are –
a. Varbinary
b. Binary
c. Longvarbinary
d. Date time – Date and time data types are used to describe date
and time values for fields in a database table.
Some of the important Date time data types are –
a. Date
b. Time
c. Timestamp
11. In how many ways tables can be created in Base?
Answer – There are two different ways to creating the table in
database –
a. Using Design View
b. Using Wizard
12. Define the structure of a table.
Answer – A table is a collection of data components structured in
the form of vertical columns and horizontal rows.
13. Differentiate between Tuples and Attributes of a table.
Answer – Tuple is a single data item in a table. A database table can
be represented as a series of rows and columns or fields.
An attribute is a collection of data values of a single data type, one
for each row in a table.
14. What is referential Integrity?
Answer – Referential integrity is used to keep data maintained,
accurate and consistent.
Data in Base can be connected between two or more tables using
primary key and foreign key constraints.
Referential integrity helps to –
a. If there is no connected record in the main key table, records are
added to a related table.
b. Changing values in a primary if there are any dependent records
in the linked table
c. If there are any matching linked records in an associated table,
records from a primary key table are deleted.
15. What is the advantage of relationships between two tables?
Answer – Advantage of relationships between two tables are –
a. Save time as there is no need to enter the same data in separate
tables.
b. Reduce data-entry errors.
c. Summarize data from related tables.
16. What is the file extension for databases created using
OpenOffice.Org Base?
Answer – Extension for OpenOffice base is .odb.
17. List any three file formats that can be managed using
OpenOffice.Org Base?
Answer – The three file formats are –
a. .odt – This file format use for create digital document file
b. .odd – This file format use for create spreadsheet
c. .odp – This file format use for creating presentation file
18. How many types of relationships can be created in Base?
Explain each of the them.
Answer – There are three types of relationships –
a. One to One – Both tables in this relationship must have primary
key columns.
b. One to Many or Many to One – One of the tables in this
relationship must have a primary key column.
c. Many to Many – The primary key column is not present in any of
the tables in this relationship.
19. What do you mean by Sorting? In how many ways it can be
done?
Answer – Sorting means arranging the data in ascending or
descending order.
The two way to arranging the data is –
a. Ascending
b. Descending
20. Explain Referential Integrity with the help of an example.
Answer – Referential integrity is used to keep data maintained,
accurate and consistent.
Data in Base can be connected between two or more tables using
primary key and foreign key constraints.
For example – Suppose there is two table “Student_details” and
“fee_details”,
in the student_detils table fields are –
Grno, Student_name, Address, phone_number ( here Grno is primary
key)
In the Fee_details table fields are –
Grno, Fee_date, Amount (here Grno is foregn key)
Here, both have a common field “Grno” this is known as
referential Integrity.
21. How many types of language are there in the database?
Answer – Three are two types of languages –
DDL (Data definition language) – Data definition language is used
to design and modify the structure of a database.
Common DDL commands are
a. Create – This command is used to create database
b. Alter – This command is used to modify the database.
c. Drop – This command is used to delete database tables.
DML (Data manipulation language) – Data manipulation language
provides commands for manipulating data in databases.
Common DML commands are
a. Select – This command is used to display information from the
database.
b. Insert – This command is used to insert new records in the
database.
c. Delete – This command is used to delete records from the
database.
d. Update – This command is used to modify records in the
database.
22. Name DML commands.
Answer – Data manipulation language (DML) access and
manipulate data in existing tables.
Name of DML commands –
a. Select
b. Insert
c. Update
d. Delete
23. What is the purpose of using queries?
Answer – Queries are commands that describe the data structure as
well as manipulate the data in the database. The purpose of a query
is to do calculations, integrate data from many tables, and add, alter,
or delete data from a database.
24. Which clause of Select statement helps to display specific
data?
Answer – Where clause is used to display specific data from the
database.
25. Differentiate between Where clause and Orderby clause of
SQL statements.
Answer – Where clause is used to display specific data from the
database and Orderby used to display data in ascending order or
descending order.
26. State the purpose of Update Command with the help of an
example.
Answer – The update statement is used to modify records in the
table. Example of update command is – Update Student_details set
Location = ‘Pune’ where Rollno = 10;
27. Consider the following table “Teachers”
Rollno Stud_Name DOB Address Mobile_no Gender Per
10/01
1 Jugal Mumbai 5555555555 M 98
/2003
24/03
2. Pratigya Pune 4444444444 F 82
/2002
12/12
3 Sandeep Delhi 8888888888 M 91
/2003
01/07
4 Sangeeta Banglore 6666666666 F 96
/2004
05/09
5 Satti Mumbai 7777777777 M 89
/2002
Write SQL commands:
a. To display all the information from the table whose address
is ‘Mumbai’.
Answer – Select * from students where address = “Mumbai”;
b. To list the details of all the students whose percentage is
between 90 to 100.
Answer – Select * from students where percentage >= 90 and
percentage <= 100;
c. To display the name of all the students whose gender is
Female.
Answer – Select Subject from students where Gender = ‘F’;
d. To display the list of names of all the students in alphabetical
order.
Answer – Select * from students order by Student_name;
29. Write the SQL commands to answer the queries based on
Fabric table
FabricID Fname Type Disc
F001 Shirt Woolen 10
F002 Suit Cotton 20
F003 Tunic Cotton 10
F004 Jeans Denim 5
a. Write a query for insert the following record
(“F005”, “Kurta”, “Woollen”,5)
Answer – insert into Fabric values (‘F005’, ‘Kurta’, ‘Woolen’,5);
b. Write a query to display only those fabric whose disc is more
than 10
Answer – select * from Fabric where Disc>10;
c. To display those record whose type is ‘Woolen’
Answer – select * from Fabric where type = ‘Woolen’;
d. To modify the fabric shirt by increasing discount by 10
Answer – update fabric set Disc = Disc + 10 where Fname = ‘Shirt’;
e. To delete the record of fabric F003 from table
Answer – delete from Fabric where FabricID =‘F003’;
30. Consider the following Vendor table and write the queries
VendorID VName DateofRegistration Location
V001 Mother Dairy 20-01-2009 Delhi
V002 Havmor 01-04-2015 Gujrat
V003 Amul 12-05-2012 Kolkata
V004 Kwality Walls 15-10-2013 Mumbai
a. Write a Query to display all records
Answer – Select * from Vendor;
b. Write a Query to add a new row with the following details
(„V005‟, „Vadilal‟, „2010-03-20‟, „Pune‟)
Answer – Insert into Vendor values (“V005‟, “Vadilal‟, “2010-03-
20‟, “Pune‟);
c. Write a query to modify the location of V003 from Kolkata to
Gujrat
Answer – Update Vendor Set location= “Gujrat‟ Where location=
“Kolkata‟;
31. Consider the following table “ITEM”:
Itemno Iname Price Quantity
11 Soap 40 80
22 Powder 80 30
Face
33 250 25
cream
44 Shampoo 120 100
55 Soap box 20 50
a. Display the total amount of each item. The amount must be
calculated as the price multiplied by quantity for each item.
Answer – Select price * quantity from item;
b. Display the details of items whose price is less than 50.
Answer – Select * from item where price < 50;
32. Identify the columns and data types of a table: Airlines.
Mention at least four columns with data type.
Answer –
Columns Data type
Flight No Text
No.of Passengers Integer
Airlines Text
Arrival_Time Date/Time
Departure_Time Date/Time
Fares Float

33. Identify the columns and data types of a table: Students.


Mention at least four columns with data type.
Answer –
Columns Data type
RollNo Integer
Student_name Varchar(20)
Father_name Varchar(20)
Mother_name Varchar(20)
Address Varchar(50)
DOB Date
34. Why there is a need to create Forms?
Answer – A form allows the user to enter information into a
database in a systematic manner. It is a user-defined interface that
allows users to see, enter, and edit data directly in database.
35. What is the purpose of creating Reports?
Answer – Reports help to present the data in proper manner which
is stored in the database, It also displays the data in summary
format.
36. What are the prerequisites to create a Form and Reports?
Answer –
Forms –
a. Forms help or manage to store data in a systematic format.
b. The prerequisites to create a form would be –
c. Add all the necessary fields in the form
d. Make the connection between form and the table
Reports –
a. Reports display the data in a summarized manner.
b. The prerequisites to create a report would be –
c. Data
d. Data source
37. Differentiate between Forms and Reports.
Answer –
Form
a. Forms are used to store the data in the semantic way
b. Edit, delete & modify can be easily managed
c. Auto calculation can be done easily
Report
a. Report display the data in the presenting format
b. Report can display all the record from the table
c. Edit, delete & modification cannot be done through report
d. You can take printout with the help of report
38. Can a form display data from queries?
Answer – Yes form can display the data from queries, with the help
of query you can filter the data and you can display in the form.
39. In how many ways Forms and Reports can be created in a
database?
Answer – There are two ways to create a form and report in the
database.
a. Using Wizard
b. Using Design View

You might also like