Professional Documents
Culture Documents
, Whatmethodcan yOu use to add a new table to your database in OOo Base ?
view to create a table
Use Design
(a)
create
table through table wizard
(c)
(6)enterdata directly in a blank sheet and save it as table
above
ld)all
the ,(er (a) and (b)
4 ABASEdatabase is made up of all the following components EXCEPT:
(a)tables (b) queries (c) forms
4 Whichofthe following fields would not make a suitable primary key1(Yformula
? bars
customers account number
(a)A AutoNumber field (YA date field
i An (d) A student
The default
extension of O0o BASE database is admission number
5
(a)oob (b) base
odb
(d) dbo
Theshortcut key
to create a new database is
openinZoyag/creating
(a)
a table. But when the Base started, she cancelled the dialog of
right solution froma database. She was unable to create tables. Help her do this by picking up the
the options given below.
has not downloaded Table Wizard. She must download Table Wizard also.
Zoya must either create
database
S0t les7 apated.
new blank database or open an existing database. Only in an open
IASSEL BLoAEDsYSTEM
UNIT III: DATABASE M
158
Table
INFORMATION TEECHNOG
Wizard to be used with base.
must fetch the settings for
(c) Zoya
a special extension which allowsto create tables without
install
(d) Zoya should he
database.
new database. She now wants to ne d
mistake and created a
14. Zoya has rectified
interactively. Whichher
feature of OOo BASE will help her to create the tables in thiscreate
way ?
(c) The Queries Tab (a dat atle
(a) The Tables Tab
(b) The Forms Tab The Table
using Table Wizard, Zoyais clear about what type of data Wizard
15. While creating tables
or text or date etc.)
will be stored in the
fields. For this what should she do
(
whiwleheth e
usrTng Nuanesr
(a) She should create a text file which stores the details of data types for each field. tadl
wizard ?
LET US REVISE
org (000).
OBASE is the database component of open source office suite OpenOfice.
.odb.
OThe default extension of 00o BASE database is
One can createa new database either using Table Wizard or by creating constituent tables in Desiam rou
B
T
B Joluion Time
1 The manager of acar showroom uses a database to store data about cars he sells. This is part of the databse.
a Cou you name some possible tables of this database and what kind of information would they be
storing? Name at least three tables.
a Pushali uses a database to store details of books stocked by the center. She uses the database to
produce lists of books on special offer.
Listing A Listing B
Title Price (Rs.) Title Price (Rs.)
Bulbs for Spring 90 Bulbs for Spring 90
shown in Listing A to
Specify which database operation has taken place that has converted the table
that of table shown in Listing B.
Ans.
(a) Names of possible tables : (i) Plants (i) Books (iii) Equipments and Materials
(b) Modification of record has taken place.
directed :
3. Look at the table structures shown below and do as
be present in each of the following tables
ldentify the column(s) out of the given three, which should not
() Table 1: Stock
Date of Birth Item Quantity
Item No.
GLOSSARY
INFORMATION TECH YO
Data Type Means to identify type of data type and associated features and fine:.
Primary key A designated field having unique value for each row in a table.
Aosignment
1. How can a BASE database be created ?
2. What is the need of designing tables ?
3. How can a table be created in BASE ?
4. What does a table wizard do ?
5. Can you set the primary key of a table through the table wizard?
PRACTICAL ASSIGNMENT
1. Start BASE and open new database named Employee.
2. Define structure of first table of your data-base as follows in design view.
P
A Structure of Table 1
Field Name Data type
Empcode TINYINT
Fname Text (15 characters)
B
Lname Text (15 characters)
Address Text
Structure of Table 2
Department Text
DOJ Date
Basic Salary Number
(heck Point
1. 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 as table
(d) all the above é (a) and (b)
2. Which of the following is/are not part(s) of table structure in OOo BASE ?
(a) Field Name (b) Field type (c) Length (d) Primary key
(ef size of table (humber of records
3. Which of the following represent Text field type categories in O0oBASE ?
(a) CHAR (b) VARCHAR (c) LONGVARCHAR (Yall these
* When you save a BASE database, what file format do you use ?
(a) .adp. (b) xml. (c) .mdb ) .odb
5. The
legal empty value in BASE database is termed as
(a) Hollow (b) empty (c) void (GY null
6.
TIMESTAMP belongs
(a) Integer
to field type in BASE.
(b) Time ()Bate/Time (d) Text
1.
Which of the following is are not a BASE field type?
(a) TinyINT (bPercernt (c) Double a BigDouble
UNIT II: DATABASE MANAGEMENT SYSTEM
172 INFORMATION TECHINOLOGy
numbers?
8. Which of the following field types can represent upto 5 digits
(SMALLINT)
(b) Real
( Small Integer
(a) Integer([NT)
(d) Float numbers or text in
cannot allowintegers or them ?
9. Which of the following field types (c) Binary
(a) Xes/No (b) Image these
(e) none of
10. . (d)
Which
all ofthe
the following
above field properties ensure that "data cannot be skippedin the field" or "feld cann,
In a text type data field we can put maximum >characters. [CBSE Sample Paper 2011]
Matchthefollowing:
22
Part A
Part B
(o) Default Value () Maximum length of a text field or numeric field
(0) Length (ii) Number of places to the right of the
decimal
(c) Format example (ii) Data's display layout
Decimal Places (iv) A value that gets entered in a field
() automatically when new
records are entered.
UNKalai
174
one of the tables. there is afield namely
INFORMATION TECHYOLG
employees, in
tables for yearly Bonus is
30. While creatingorganisation, minimumguaranteed
policy of the performance
depending upon theautomatically inserted in the Bonus
What
of the employee. fieldshould 2 Isha set
{7500/-
Bonus can
so that Bonus. behe even pr
amount of bonus is (b) Length property rmin Ttge
property
(a) Entry Required (af Default value property
Decimal places property
(c) days, salary and
bonus fields have the same
31. In tables, the
age, number of
money values (Salary and Bonus) should data type
However, the boss
clearly
wants the field storing
tell about the money value.
What can Isha do to achieve this ? Numbe
that they from others
cannot show two number fields differently
(a) Isha
\o Isha should choose the field format for Bonus and Salary as the currency format.
(c) Isha should use Text type for these fields so that Commas can be inserted in the values
and Salary as Text type and type "Rs.
should change the field type of Bonus
(d) Isha
int these fields.
with eah
32. Isha's value
office is a progressive office where each employee must commit to a charity cause. Whi
Creating table, Isha has been asked to ensure that 'Charity Cause' field never goes blank for aN
achieve this ?
emplovee. How can Isha
property length (b) By setting field property Default Valye
(a) By setting field Places rby setting ield property Entry Reuisd
(c) By setting field property Decimal
P
A
LET US REVISE
T
edited in design view.
I Atable can be Created or length fields alot x
B fields irrespective of their contents whereas variable
DFixed length fields allot same length to all
the field.
much length as needed by the contents of
Text, Date/Time, Numeral and Special.
O BASE datatype have these categories : Memo[LONGVARCHARJ.
Text[VARCHARJ, Text/VARCHAR-IGNORECASE] and
OTet data types are ed(fx)[CHAR.,
OMaximum length of all text type field is 2 GB.
Date/Time[TIMESTAMP].
0 Date/Time data types are : Date(DATE], Time[TIME], Float, Real Double, Numenc a
D Numeral data types are : Tiny Integer, Small Integer, Integer, Big Integer,
Decimal.
OSpecial datatypes include : Yes/No, Image, Binary and Other. Default vlue andFormat
Decimal Places,
O Different field properties that can be set are: Entry Required, Length,
example.
O Null value represents a legal empty value in adatabase.
Ans.In
BASE, we can have following types of Numeric fields:
length of
TinyInteger [TINYINT]. This field. accepts integers or whole numbers with afixed
() three (3) spaces.
Small Integer (SMALLINT,. This field accepts integers or whole numbers with a fixed length
of five (5) spaces.
(i)Integer |INT]. Thisfield accepts integers or whole numbers with afixed length of ten (10)
f up the field witha value you set automatically.
spaces. It also) has an auto value eature thattills
BigInteger
(ie) nineteen (BIGINT]. This field accepts integers or whole numbers with a fixed length of
(19) spaces. It also has an auto value feature that fills up the field with a value you
set automatically.
2. When should you prefer a. NUMERICfieldtype over INT ? types of numbers such as
Ans NUMERIC field type should be used when we need to store all
numbers with decimals, fractional numbers etc. On the other hand, INT field type
whole numbers,
should be used when purely
whole numbers are to be stored in the field.
by default value?
3. What do you understand field or control.
Ans. The default value is used to specify the default value for a
when a new record is created. For
The default value is automatically entered in afield or control
House". When users
Pvamnle. in Student table, you might set the default value for House as "Tagore different house.
or enter the name of a
add records to the table, they can either accept this value
Date[DATE] and Time(TIME] field types ?
A How is the feld type Date Time (TMESTAMPl different from field type stores the
the Time[TIME]
Ans. The Date[DATE] field type stores the dates only and combination of both Date and Time types
STAMP] is a
times only. But the field type Date/Time[TIME
known as timestamp.
and hence can store a combination of date and time, also
5. What is the significance of Null values ?
in a field when table demands data for the
Ans. Nullvalues are very useful while entering data values are legal empty values in BASE,
Null
field but user does not have any value to enter. Since
they can be entered in such situations.
6. Do as directed :
[CBSE Sample Paper 2011, Term I]
personal
and is asked to handle the records containing
() Pronita is a programmer in an institution fieldnames, which you think must
five
informationof the teachers teaching in the institution. Suggest
be present in the table called Teacherinfo.
the question.
() Look at the table called "Item" given below and answer
ItemStock ItemDOP Quantity Purchased
ItemId Item Name
ItemStock Number
ItemDOP Date
Number Cost(Rs)
1 41.50
63.00
3 44.50
56.00
5 67.50
databast
the
She Uses
(a) Rushali uses a database to store details of books stocked by the center.
produce lists of books on special offer.
Listing B
Listing A Price(Bs)
Title Price (Rs.) Title 90
Bulbs for Spring 90 Bulbs for Spring 115
Green Lawns 115 Green Lawns 195
Orchids 195 Orchids 300
tableshown
Specify which database operation has taken place that has converted the
that of table shown in Listing B,
KEla
CREATING/EDITINGTABLES IN DESIGN VIEW
177
creatingthe tables, Bushali wants to make sure that Price
acccidentally. What can she do to ensure this ? column must not be left blank
deliberatelyor
create a new table where she wants to store the
ants to details of registered customers. To
numbers of the Customers, she has
storethephone decided the data
datatype. Butshe is confused which datatype suits her need the most. type
Helpshould be athis datatype.
her decide
Price
whole-number
shouldbe data type of column and why?
What
D
record has taken place.
A1s.
Insertion of
c£n set
the Field Property Entry Required to yes.
She
())Integer would suffice as it offers 10 spaces. Most phone numbers fit in this width. However,
ifthe phone numbers are bigger than 10 digits then Big Integer [BIGINT] should be used
that
offers 19 spaces.
typeof,Price column must allow decimal point hence
Thedata
suited for it.
Float, Real or Numeric types
best
areHouse conducts adventure trips and adventure cainps. When clients make a booking, Mira, the
¿Jowreka
enterstheir details in a database.
gitary,
4 Check the data types and the sample values. Are all data types correct? If no, then which type(s)
wOuld
you change and why?
0) How would you ensure the specifications in
(o) The
Remarks column?
database
Calculate howcurrently
holds information concerning 5,000 clients.
Ans. many bytes will be required to store all records. (Show your working.)
(a) Yes, all
data types are correct. Even though pincode stores a numeric value, yet Text data
ype can be effectively used
() Text for it because,
data types allow entry of numbers.
(ii) Since no
calculation is required for it thus it can be stored in Text data type without
b) For hinderingnotany operation.
"must be
empty", we set the field property Entry Required to yes for the field
FiForrst"NRockame climbing" no value
if is specified, we can set default value field property to "Rock
limbing" for the field Course Name.
SYSTEM
CREATING//EDITING TABLES IN DESIGN VIEW 177
Session3
(0) While Creating the tables, Rushali wants to make sure that Price column must not be left blank
doliberately or accidentally. What can she do to ensure this ?
() Rushali zpants to create a new table where she wants to store the details of registered customers. To
store the phone numbers of the customers, she has decided the data type should be awhole-number
data tupe. But she isconfused which datatype suits her need the most. Help her decide this datatype.
(a) Whaf should be data type of Price column and why?
Ans.
(a) Check the data types and the sample values. Are all data types correct? If no, then which typels)
would you change and why?
(b) How would you ensure the specifications in Remarks column?
() The database currently holds information concerning 5,000 clients.
Calculate how many bytes willbe required to store all records. (Show your working.)
Ans.
(a) Yes, all data types are correct. Even though pincode stores a numeric value, yet Text data
type can be effectively used for itbecause,
() Text data types allow entry of numbers.
(i) Since no calculation is required for it thus it can be stored in Text data type without
hindering any operation.
(b) For "must not be emply", we set the field property Entry Required to yes for the field
FirstName
For "Rock climbing" if no value is specified, we can set default value field property to "Rock
climbing" for the field Course Name.
UNIT II: DATABASE MANAGEMENT SYSTEM
178 INFORMATION TECHNOLOGty
its field sizes.
(c) Total size of one record is sum of allof
Hence,
=124 hkor
Size of 1 record :4+ 20 +20 + 30 +20+ 8 + 6+6+20
124 *5000
Bytes required by 5000 records =
=620000 bytes 620 Kilo bytes (KB)
= 620000/1024 KBs =606 KBs
Exactly,
directed :
10. Look at the table structures shown below and do as
present in each of
ldentify the column(s) out of the given three, which should not be the following tables:
) Tablel:Stock
Item No. Date of Birth Item Quantity
GLOSSARY
Data Type Means to identify type of data type and associated features and functions.
Data Validation Process of ensuring the entry of only valid data (as per the rules) in the table.
Assignment
1. How are field types Boolean and TINYINT different from one another ?
2. Write the difference between INT and TINYINT data
types.
3. What do you mean by default value of a field in BASE and how can it be set ?
4. What arethe different Date/Time formats available in BA SR SS, ! 2
Kalal