Final DB
Final DB
INTRODUCTION TO DATABASE:
1. _________is usually suitable for less amount of data. (Relational/Flat file)
5. A storage container storing data pertaining to simple object, subject or purpose is known as________
(a) Table (b) Query
(c) Report (d) Form
7. A statement that gives you filtered data according to your conditions and specifications, is
called________.
(a) Table (b) Query
(c) Report (d) Form
8. An interface in user-defined layout that lets users view, enter or change data in tables, known
as________.
(a) Table (b) Query
(c) Report (d) Form
9. A formal, presentable printed document that lists data in formatted way is known as __________.
(a) Table (b) Query
(c) Report (d) Form
10. Named collection of fields which represent a complete unit of information is called_________.
(a) Field (b) Record
(c) Table (d) None of these
15. When a primary key contains more than one field, it is known as_________ .
(a) Alternate key (b) Candidate key
(c) Foreign key (d) Composite key
28. One piece of data about a single person or thing is known as a_____
(a) record (b) file
(c) field (d) database
29. All of the information about one person or one thing is known as a ______.
(a) database (b) field
(c) file (d) record
31. To find a particular record or set of records in a database you would use a ______.
(a) query (b) report
(c) table (d) relationship
32. To organize the different tables of related data, a relational __________________ are used.
33. To display data in a specific format or distribute a summary of data,_________ are created.
34. To get data input from user in a well-organized, formatted way on screen, _________are used.
35. In the database view of a relational database, a row of information is called a _________.
36. To control how information is entered into a database, programmers and database administrators
create _______ to help ensure data integrity.
37. In a relational database, a common field that links two tables in a relationship but not a primary key is
called a _________ key.
38. The database use common fields to create links between tables. Thus such databases are called
a_______ database.
39. Primary key is used to______ identify the record in a table.
41. A Foreign key is linked to the primary key of the same table. T/F ?
43. If a piece of is stored in two places in the database, then storage space is wasted and changing data in
one place will not cause data inconsistency. T/F?
45. In a relational database, two tables cannot have a common field. T/P
48. Akshat wants to store a huge amount of information about his firm in a database.
Which type of table organization would be most suitable for this purpose?
(a) Relational (b) Flat File
(c) Either Relational or Flat file (d) Hierarchical
49. Juan has stored the data related to his work in multiple files.
He did not realise that same data related to an important thing was stored in three different files
separately.
This type of storing data at multiple locations is known as data ________________.
(a) Inconsistency (b) Redundancy
(c) Standardisation (d) None of these
50. Juan has stored the data related to his work in multiple files. He did not realise that same data related
to an important thing was stored in three different files separately.
This led to a huge problem for Juan when he modified the data in one file while forgetting to update other
files. This problem is known as data ________.
(a) Inconsistency (b) Redundancy
(c) Standardisation (d) None of these
51. To support and help Juan, his brother's friend Prabhnoor has come. He explained the need and role of
database in such a case.
So he advised him to create tables such that there should be a way to recognise each row of the table
uniquely. What does Prabhnoor mean by this way ?
(a) He wants to create a foreign key in each table. (b) He wants to club fields in a unique
way.
(c) He wants to create a field having a special value in it. (d) He wants to create a primary key in each
table.
52. While designing the database, Prabhnoor suggested that if in a table there is a field which must take
only those values which are part of a field in another table,
(where it can recognise the records uniquely), then that field must be declared as key.
(a) primary (b) alternate
(C) composite primary (d) foreign
Answers:
1. Flat File 2 (b) 3. (a) 4 (c) 5. (a) 6. (a)
7. (b) 8. (d)
9. (c) 10. (b) 11. (a) 12. (c) 13. (b) 14. (d)
15. (d) 16 (d)
17. (d) 18. (d) 19. (b. c. d) 20. (b) 21. (b) 22. (c)
23 (a) 24. (b)
25. (d) 26. (a) 27. (d) 28. (c) 29. (d) 30. (a)
31. (a) 32. database
33. reports 34. Forms 35. Record 36. Forms 37. Foreign 38. Relational
39. Uniquely 40. Database
41. F 42. F 43. F 44. F 45. F 46. T
47. F 48. (a)
49 (b) 50. (a) 51. (d) 52 (d)
Let us Revise:
BASE offers many features like tables, forms, queries and reports to manage data,
A table refers to a storage container storing data pertaining to single object, subject or purpose.
A query is a statement that giver you filtered data according to your conditions and specifications.
A form is an interface in user specified layout that lets users view, enter, or change data directly
in the table.
Solution Time:
1. What is database? What is its significance?
Ans. A database is a collection of logically related data.
The database systems store data centrally at one place wherefrom all applications can get the data
required.
The centralised storage facilitates many advantages like:
(i) Controlled Redundancy
(ii) Data Sharing
(iii) Data Consistency
(iv) Standardization
(v) Enhanced Data Security.
A table is a storage container that stores data pertaining to single object, subject or purpose.
For example, an employee table may contain all information pertaining to an employee eg, employee no.
employee name, designation, department, grade, basic etc.
Similarly, Attendance table may contain data pertaining to the attendance of employees e.g., employees'
no, months, years, no, of days worked, number of leaves takens,
CL, LWP, PL etc. (CL-Casual Leaves, LWP-Leaves Without Pay, PL - Privilege Leaves)
Both these tables reside in single database as both of them are related to single object called employee.
Two tables are maintained to minimize redundancy
Therefore, tables provide a way to store related data together under one roof, taking care of things like
reduced redundancy, standardization and data integrity.
Ans. In a flat database, all the data is stored in a single file e.g., a spreadsheet.
In a relational database, data is stored in multiple tables linked via common fields e.g., BASE of
OpenOffice.org is a relational database.
5. The manager of a car showroom uses a database to store data about cars he sells. This is part of the
database.
6. A jazz Band uses a database to keep membership records. This is a part of the database.
(a) The MemberNumber 0112 is used twice. Explain why this must be a mistake.
(b) Write down a valid MemberNumber for Jugal.
(c) Name field also has unique values for all the records. Can it be made primary key? Why/why
not?
Ans
a)MemberNumber uniquely identifies the members. It is most likely to be the primary key or keyfield.
Hence, one value cannot be used more than once in this column. Hence use of 0112 twice is
wrong as it is the primary key field.
(b) 0113 (or any other number which is different from earlier entered member numbers.)
(c) Though Name is having unique values as of now, there is no guarantee that if the band grows there
would not be multiple people with similar names.
Hence, as of now it can be made primary key but should not be made as in future its values may be
duplicate.
9. Sanchita is working for a nationalized bank and is in the process of creation a table to store the details
of customers of the bank.
Find out, which of the following Fields of table Bank can be selected as Primary Key Candidate Key and
Alternate Key.
Ans.
Primary Key: AccountNo
Candidate Key : AccountNo and PANNumber
Alternate Key: PANNumber
10. What is a key difference between a foreign key and a primary key?
Or
What is a Primary Key? How is it different from foreign key?
Ans. A foreign key is a field or fields that refer to a primary key of another table while a primary key is a
field in a table that uniquely identifies each record in a table.
2. What method can you use to add a new table to your database in OOo Base ?
(a) Use Design view to create a table (b) create table through table wizard
(c) enter data directly in a blank sheet and save it as table (d) all the above (e) (a)
and (b)
4. Which of the following fields would not make a suitable primary key?
(a) A customers account number (b) A date field
(c) An AutoNumber field (d) A student admission number
8. A table is a set of data elements that is organized using a model of vertical_______ and
horizontal______.
(a) Rows, Tables (b) columns,Rows
(c) Rows, Columns (d) forms, Reports
9.______ specifies the type of data that may be stored in a field.
(a) Autosave (b) Autovalue
(c) Field Type (d) Entry
11. After opening a database, you can create tables interactively using
(a) Tables Tab (b) Tools menu
(c) Edit menu (d) Table wizard
15. Zoya has rectified her mistake and created a new database. She now wants to create data tables
interactively.
Which feature of OOo BASE will help her to create the tables in this way?
(a) The Tables Tab (b) The Forms Tab
(c) The Queries Tab (d) The Table Wizard
16. While creating tables using Table Wizard, Zoya is clear about what type of data (whether numeric or
text or date etc.) will be stored in the fields.
For this what should she do while using a table wizard?
(a) She should create a text file which stores the details of data types for each field.
(b) Zoya cannot define the type of data to be stored, in Table Wizard.
(c) After selecting the fields, Zoya should choose the Field Type for each field in the table, along with
other details.
(d) Zoya can only change the data type from the default types, after Table wizard has created the table.
LET US REVISE
BASE is the database component of open source office suite OpenOffice.org (00o).
One can create a new database either using Table Wizard or by creating constituent tables in
Design View.
Answers:
1. (c) 2 (e) 3. (d) 4. (b) 5. (c) 6. (a)
7. (b) 8. (b) 9. (c) 10. (a) 11. (d) 12 (i) False, (ii) True,
(iii) False, (iv) False
13. (b) 14. (b) 15. (d) 16. (c)
2. Which of the following is/are not part(s) of table structure in OOo BASE?
(a) Field Name (b) Field typ (c) Length
(d) Primary key (e) size of table (f)number of records
3. Which of the following represent Text field type categories in OOo BASE?
(a) CHAR (b) VARCHAR
(c) LONGVARCHAR (d) all these
4. When you save a BASE database, what file format do you use?
(a) adp. (b) xml.
(c) .mdb (d).odb
8. Which of the following field types can represent upto 5 digits numbers?
(a) Integer(INT) (b) Real
(c) Small Integer (SMALLINT) (d) Float
9. Which of the following field types cannot allow integers or numbers or text in them?
(a) Yes/No (b) Image
(c) Binary (d) all of the above (e) none of these
10. Which of the following field properties ensure that "data cannot be skipped in the field" or "field
commit be left empty"?
(a) Format (b) Entry Required
(c) Default Value (d) Length
12. Suppose you'd like to set up a table in BASE to monitor your growing collection of DVDs. In that
table, each DVD will be entered as a:
(a) record (b) long integer
(c) column (d) field
13. When you define a field for a table, which of the following parameters does BASE always consider
optional?
(a) Field Name (b) Data Type
(c) Description (d) Field Size
15. The organizing of data according to text, number, currency, date/time, etc is called
(a) Data(b) Type
(c) Date type (d) Data structure
17. Out of the following which one is most appropriate data field in context of employee table if only one
of these is required?
(a) Age in years (b) Date of Birth
(c) Age in days (d) Age in months
18. What data type should you choose for a zip code field in a table?
(a) Text (b) Number
(c) Varchar (d) All the above
19. Which of the following fields would not make a suitable primary key?
(a) A customers account number (b) A date field
(c) An AutoNumber field (d) A student admission number
(a) The type that dictates what sort of data can be stored within a field is known as_________.
(c) To store an object like image, you need to create a field in table, having field type as______.
(d) In a text type data field we can put maximum ______ characters.
23. The of a table is used to modify the design of a table, like modifying the name of a field or changing
the data type of a field.
(a) Datasheet View (b) Design View
(c) Table View (d) Wizard View
24. You can select multiple fields of a table in design view by using the ______ key.
(a) Alt (b) Spacebar
(c) Shift (d) Ctrl
25. In the datasheet view of the Student table, the Student Address field needs to be displayed as
Address.
Which field property can be used to achieve this?
(a) Caption (b) Required
(c) Validation Rule (d) Default
26. _______data type stores date and time values between the years 100 through 9999.
(a) Date (b) Time
(c) Date/Time (d) Memo
Competency Based Questions
27. Isha, Zoya's friend, has also learnt about Databases. She is a person of details. She feels that rather
than creating tables interactively,
she should create the tables from scratch by typing the field name, type, and other settings. What should
she use to create tables in this manner?
(a) Table Wizard (b) Design View
(c) Data View (d) Tables tab
28. Isha has successfully created her first table. But while entering data, she realised that she forgot to add
one field. She has already entered a few records.
What can she do to add a new field in the already created table?
(a) Isha should delete the old table and create a new table.
(b) She will have to delete all the records in the table before she can add a new field.
(c) She should open the table in Design view and add the new field.
(d) Adding new field to an existing table is not allowed in Base.
28. Isha has now some experience of creating and updating tables. Her boss has asked her to create a table
about the attendance of the employees.
Along with other details, the table should also have a field that can store the date and time of entry in the
office. What should be the field type for this field?
(a) Date (b) Time
(c) Timestamp (d) All of these
Answers:
1. (e) 2 (e,f) 3. (d) 4. (d) 5. (d) 6. (c) 7. (b.
d)
8. (c) 9. (d) 10. (b, c) 11. (d) 12. (a) 13. (c) 14. (b)
15. (c) 16. (c) 17. (b) 18. (b) 19. (b) 20. (a)
21. (a) Data Type, (b) Primary Key, (c) Image, (d) 255
22. (a)(iv); (b)(i); (c)-(iii) ; (d)(i)
23. (b) 24. (d) 25. (a) 26. (c) 27. (b) 28. (c)
LET US REVISE
A table can be created or edited in design view.
Fixed length fields allot same length to all fields irrespective of their contents whereas variable
length fields allot d much length as needed by the contents of the field.
BASE datatype have these categories: Text, Date/Time, Numeral and Special.
Text data types are Text (fix) (CHAR), Text [VARCHAR), Text [VARCHAR-IGNORECASE]
and Memo [LONGVARCHAR).
Different field properties that can be set are: Entry Required, Length, Decimal Places, Default
value and Format example.
Solution Time
1. Discuss various types of numeric fields that you can have in BASE. Which field type is the default
numeric field type ?
Ans:
In BASE, we can have following types of Numeric fields:
(i)Tiny Integer [TINYINT]. This field accepts integers or whole numbers with a fixed length of three (3)
spaces.
(ii) Small Integer [SMALLINT]. This field accepts integers or whole numbers with a fixed length of five
(5) spaces.
(iii) Integer [INT). This field accepts integers or whole numbers with a fixed length of ten (10) spaces. It
also has an auto value feature that fills up the field with a value you set automatically.
(iv) Big Integer [BIGINT]. This field accepts integers or whole numbers with a fixed length of nineteen
(19) spaces. It also has an auto value feature that fills up the field with a value you set automatically.
4. How is the field type Date/Time (TIMESTAMP] different from Date[DATE] and Time[TIME) field
types ?
Ans. The Date[DATE] field type stores the dates only and the Time[TIME] field type stores the times
only.
But the field type Date/Time[TIME STAMP] is a combination of both Date and Time types and hence
can store a combination of date and time, also known as timestamp.
6. Do as directed:
(i) Pronita is a programmer in an institution and is asked to handle the records containing personal
information of the teachers teaching in the institution.
Suggest five fieldnames, which you think must be present in the table called Teacherinfo.
(ii) Look at the table called "Item" given below and answer the question.
ItemId ItemName ItemStock ItemDOP QuantityPurchased
Ans.
(i) TNo, TName, DOB, Address, B Salary.
OPERATIONS ON TABLES:
1. To add a new record, you can use Insert → _____ command.
(a) Value (b) Data
(c) Record (d) Row
3.The process of arranging records in order by one or more fields is known as_____ .
(a) Sorting (b) Linking
(c) Ordering (d) Editing
4. The Sort ____ tool is used to sort the records by the current field in order from Z-A or highest number
to lowest number.
(a) Ascending (b) Increasing
(c) Descending (d) Decreasing
5 The Sort ____ tool is used to sort the records by the current field in order from A-Z or lowest number
to highest number.
(a) Ascending (b) Increasing
(c) Descending (d) Decreasing
8. A ________table relationship is where multiple records of a table are related to a single record of
another
(a) one-to-many (b) many-to-one
(c) one-to-one (d) many-to-many
10. A______relationship is where multiple records of a table are related to many records of another
table. 10 A
(a) one-to-many (b) many-to-one
(c) one-to-one (d) many-to-many
Customers Orders
1 N
Customers N 1 Orders
Customers N N Orders
Customers 1 1 Orders
15. When applied to 1:N relationships, the term "parent" refers to the many side of the relationship
since a child may have many parents. True/False
16: ____ is a rule states that every foreign key value must match the primary key value of a record in
another table, or must be null.
17. In a one-to-many relationship, the Primary Key field is in the______ side of the relationship
18. In a one-to-many relationship, the Foreign Key field is in the __________ side of the relationship.
20. There can be only one relationship defined for a table. True/False
21. Ramya has been assisting her teacher in typing the marks details of all students in the class. After
inserting the details in a data table, she showed it to her teacher.
But her teacher said that records should be listed in a way such that the topper details are at the top
second topper below it; third topper below the second topper and so on.
All the records should be listed in this way only. What should Ramya do now?
(a) Ramya should create a new table and enter the marks details again as required by teacher.
(b) Ramya should cut the records and paste in the same table as per the order required,
(c) Ramya should sort the table using the default sort settings:
(d) Ramya should sort the table on the basis of total marks field.
22. Ramya entered the marks details of students in a table namely Marks, which has fields as Rollno
Subject1, Subject2, Subject3, Subject4, Subject5, Total Marks
The other details of the students are available in Students table which has fields as RollNo, Name, DOB,
Admission No., Address.
For preparing the report card both these tables are to be used together as one record in both tables
corresponds to the same Rollno.
What type of relationship do Students and Marks tables have between them?
(a) One to One (b) One to Many
(c) Many to One (d) Many to Many
23. In the same database (of Students and Marks tables), there is a Subjects table which stores the
details of subjects being taught in a class.
It has fields as SubjectID, Subject Name, Class, Year There is one more table namely StuSubjects which
stores the details of subjects opted by a student.
It has fields as Rollno, SubjectID. A student has to opt for minimum 5 and maximum 7 subjects.
What type of relationship exist between tables stusubject and subjects (one rollno, multiple subjects)?
(a) One to One (b) One to Many
(c) Many to One (d) Many to Many
24. The database has Students table containing students' details and Marks table containing marks of
the students, linked via Rollno field.
While deleting a record from the Students table, BASE is not allowing it to happen as long as there is a
corresponding record in the Marks table,
for the rollno being deleted from Students table. This is happening because of which important rule(s) of
DBMS?
(a) Integrity (b) Clarity
(c) Referential integrity (d) Data Consistency
Answers:
1. (c) 2. (b) 3. (a) 4. (a) 5 (c) 6 (c) 7. (c)
8. (b) 9 (a) 10. (d) 11. (a) 12. (b) 13. (d) 14. (c)
15. F 16. Referential Integrity 17. One 18. Many 19. relationship
20. F 21. (d) 22 (a) 23 (b) 24. (c)
LET US REVISE:
To edit data in a table, open the table in data view. New record can be inserted using Insert
Record command.
Relationships are the associations established between common fields in two tables in a
database.
Referential integrity is a system of rules that a DBMS uses to ensure that relationships between
records in related tables are valid,
and the user can't accidentally delete or change related data.
Solution Time
1. What is sorting? How is it useful?
Ans. Sorting is a process of arranging the data into some meaningful order on the basis of one or
multiple field-values.
Sorting makes it easier to understand, analyse or visualize data.
One-to-Many and Many-to-One relationships are two sides of the same coin e.g., Teacher and Student
tables have one-to-many relationship
(one teacher record is related to many student records as one class teacher can teach many students)
while Student and Teacher tables have many-to-One relationship (many students have only one class
teacher).
QUERIES IN BASE:
1. A database ______ is a stored object that extracts data from a database as per a condition and
presents it in a readable, formatted form.
(a) form (b) query
(c) report (d) link
2. A ______retrieves records from one or more tables and then displays the result in a formatted
readable form.
(a) form (b) table
(c) query (d) report
6. While creating a query, expression will select all the fields from the table Marks.
(a) All.Marks (b) Marks.All
(c) Marks.Full (d) Marks.*
7. In order to display only those records in a query based on Marks table, where total_marks are more
than 74.9, which of the rows from the
bottom section of the Query Design view will be used to define the condition for the query?
(a) Field(b) Function
(c) Criterion (d) Alias
8. In order to specify the query condition so that the total marks are in the range 50 to 100, the Criterion
row of the Query Design view should contain.
(a) 50 and <= 100 (b) Between 50 and 10 anywhere
(c) Between 50 and 100 in the column total_marks (d) 50 and 100 in the column total_marks
14. Fouzia's mentor has asked her to create a detailed report from two tables Interns and Performance
where she wants only those records should be
listed where call hours are more than 150. What should Fouzia do to create this query ?
(a) Fouzia should use Query Wizard.
(b) Fauzia should use the Query Design view to create this query.
(c) Fouzia should herself pick records from Performance table as per the matching criteria and then list
their details along with matching records from Interns table.
(d) All of the above are equally useful options.
15. Fouzia's mentor wants to know the information such as Average Call hours, Minimum Call hours,
Maximum Call hours, in a query. What should Fouzia do to prepare this query?
(a) Fouzia should now make use of calculator to calculate the asked details.
(b) Fauzia should prepare a summary Query using aggregate functions.
(c) Fouzia should create a detailed query and manually enter the calculated details below the prepared
query.
(d) All of the above mentioned options are equally useful.
Answers:
1. (b) 2. (c) 3. (c) 4. (f) 5. (d) 6 (d) 7 (c)
8. (d) 9. (b), (d) 10. (c) 11. T 12. F 13. (c) 14. (b)
15. (b)
LET US REVISE
A database query is a stored object that extracts data from a database as per a condition and
presents it in a readable, formatted form.
In 00o Base, queries can be created through a query wizard as well as in design view.
Queries can aggregate or group data using group fields that contain duplicate entries in it.
Solution Time
1. What's a query?
Ans. A query is a way to get specific information from the database.
FORMS IS BASE
1.________are the objects that are used to get data from user in interactive manner through a user-
friendly interface.
(a) Tables (b) Forms
(c) Queries (d) Reports
2. A is an interface in a user specified layout that lets users to view, enter, and change data directly in
database objects such as tables.
(a) frame (b) form
(c) relation (d) report
7. _______are easier way to get data from user and store in tables.
9. A form once created, the height/width of entry box cannot be changed. True/False
11. Which of the following properties may be set/edited for field boxes in a form?
(a) Enabled (b) Visible
(c) Alignment (d) All of the above (e) None of these
13. Jerath has created a form, but he is not happy with it. There are two issues that he is facing:
(a) the entry boxes for fields Address and Project Details are too small, and
(ii) the field Past Grade must not appear on the form.
Can you suggest Jerath about this (Pick one from below)?
(a) Jerath should create a new form from scratch.
(b) Jerath should first create a new table minus the field Past Grade and then create a form based on the
new table.
(c) Jerath can easily open the form in Design view and change height and width for fields Address and
Project Details.
Also, he can make Past Grade field invisible in the form design view.
(d) Making these changes are not possible once the form is created.
14. Jerath has been using forms for inserting records in table and searching for records in tables.
But 14 now his boss wants that for insertion, deletion and searching, a common interface should be used.
What should Jerath do ?
(a) Jerath should consult IT cell to find a solution for this.
(b) Having a common interface for Insertion, deletion and searching is not possible.
(c) Jerath should create a new interface for insertion, deletion and searching.
(d) Jerath can use the same existing form for inserting as well as deleting and searching of records
Answers:
1. (b) 2. (b) 3. (b) 4. (d) 5. (c) 6. (c) 7.
Forms
8. T 9. F 10. (d) 11 (d) 12. (b) 13. (c) 14. (d)
REPORTS IN BASE
1.A database ______ is the formatted representation of data in various database objects like tables and
queries.
(a) forms (b) SQL Query
(c) Report (d) None of these
7. Mishi created the report using Report Wizard and showed it to her boss. Her boss is still not happy.
He said, "the records of same hardware item should appear together; and for each hardware item, its
multiple orders should appear datewise".
What should Mishi do now ?
(a) Mishi should simply say that this is not possible at all.
(b) Mishi should first create a table in the order as specified by the boss and then create a report based
on this new table.
(c) Mishi should add a Group field in the report as ItemID and sort the group on the basis of Order date.
(d) All the above options are equally useful.
LET US REVISE
A database report is the formatted result of data coming from database objects like tables or
queries.
Anwers:
1. (c) 2. (d) 3. (d) 4. Reports
5. T 6. (c) 7. (c)