Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

MS-ACCESS PART-1

Introduction to OpenOffice.org Openoffice.org is the leading open source office software suite. Open source software (OSS) is software where the source code is freely available to the public. Users are encouraged to study, change, improve and at times also to distribute the open source software. It is used entirely free of any license fees. OpenOffice.org can be downloaded from the Web Site www.openoffice.org. Database: A database is a collection of logically related data. DBMS (Database Management System): A computer program that manages a database effectively and efficiently. RDBMS: A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model. In this, data as well as relationship among the data is stored in the form of tables. Examples of RDBMS are MS-Access, OpenOffice.org Base, SQL Server, Oracle etc. Advantages of Database Databases reduce data redundancy to a large extent Duplication of data is known as data redundancy. DBMS stores all data at one place and all application programs that require this data can refer to the same central place. Databases can control data inconsistency to a large extent Multiple mismatching copies of same data is known as data inconsistency. Databases ensure data consistency by ensuring there is no duplication of data. Databases facilitate sharing of data Databases store data which may be shared by multiple users. Databases enforce data security and standards Databases ensure security of data by ensuring that the authorized user has the necessary rights and privileges on the data.

The various objects that can be created in MS-Access: Table- A table is a storage container that stores data related to a single object, subject or purpose. A table is made up of rows and columns. It is also known as a relation. Query- A query is a statement that gives the data from one or multiple tables according to the specified conditions Forms-A form is an interface that lets the users view, enter and change data in the tables. Reports-A report is an effective way to present data in a formatted printable format.

Terms in context of a table

ROW or RECORD- In a table database, a row (record) is the set of fields within a table that are relevant to a specific entity. A row represents complete unit of information about an entity (person, place, subject, or thing). FIELD or ATTRIBUTE- A field represents one category of information about the entity (person, place, subject, or thing. PRIMARY KEY-A primary key is a field or combination of fields that uniquely identifies the rows in the table. A primary key field cannot have repetitive values and cannot be left blank (cannot have NULL values) TABLE: EMPLOYEE PRIMARY KEY ENO 1 2 3 4 ENAME RAM SHAM SITA RITA FIELD ESALARY 1000 2000 3000 1500 EAGE 20 25 30 40

ROW

A table can be viewed in two ways: Design view: This view lets the user to specify the structure of the table. The user can specify the field names, data types, and descriptions about the database table. Datasheet view: This view displays data from a table in a row-and-column format. In Datasheet view, you can edit fields, add and delete data, and search for data.

Creating table in Design View FIELD NAME- A field name is a label that indicates the type of information being stored in the field. FIELD DATA TYPE- The data type of a field determines the type of values that can be stored under a field. The following data types can be set: Text Fields with this data type can contain upto 255 characters. It is the default type applied to a field. The default size for this field is 50. Memo-Fields with this data type can contain upto 64,000 characters. They are used for storing greater amount of information than a field with Text data type. E.g. a field in which you want to store the past medical history of a patient. Number-Various types of numbers can be stored and that can be chosen from the field size property. The various options available are Byte: It occupies one byte. Allows values from 0 to 255. Integer: It occupies two bytes. Long Integer: It occupies four bytes and range of integers is more than what is available with a field size of Integer Single: It occupies 4 bytes. It can store decimal numbers with six digits of precision Double: It occupies 8 bytes. It can store decimal numbers with six digits of precision. Double is the default field size when the data type chosen is Number.

Date/Time: It stores date and time values. AutoNumber: A number which is automatically incremented by Access whenever a new record is added. They are usually a tables Primary Key. Fields with this data type cannot be updated (i.e. once they take a value for a particular record their value cannot be changed.) Yes/No: Only Yes or No values can be entered

FIELD PROPERTIES Field Size: This property can be set for the Text and number data types. For Text data type, it can be used to set the maximum number of characters that can be entered in that field. For Number data type, the user can choose one out of the following options: Byte, Integer, Long Integer, Single, Double. Default Value: This property specifies the value that gets entered automatically in a field when records are created. Allow Zero Length: This property is used to specify whether a zero-length string (" ") is a valid entry in a table field. The AllowZeroLength property applies only to Text and Memo data types. Default value is No for this property. Required This property specifies whether or not a value is required in a field. If this property is said to yes, then a value must be entered in the field at the time of data entry. The default value is No for this property. Important points to remember with respect to Required and Allow Zero Length property are: o If you set the AllowZeroLength property to Yes, a zero-length string will be a valid entry in the field regardless of the Required property setting. o If you set Required to Yes and AllowZeroLength to No, you must enter a value in the field, and a zero-length string won't be a valid entry. Validation Rule: This property can be set to restrict the values that can be entered in a field. Validation Text: It specifies the error message that appears if the field does not satisfy the conditions given in the Validation Rule setting. Examples of Validation rule for Number-based and Date-based columns: Use Operators: >, <, =, <>(not equal to), >=, <=, Between __and ______ Validation Rule <100 [Age]<=100 [Code] Between 1 and 10 [Age]<>0 [Hiredate]<1/1/95 [Hiredate]>= Date( ) Description Must be less than 100. Age must be less than or equal to 100. Code must be between 1 and 10. Age must not equal 0. Hire Date must be a date before 1/1/95. Hire Date must be today's date or later.

Validation Rule

Description

[Hiredate]<= Date( ) Hire Date must be today's date or earlier. Pls Note: The Date() function returns the current systems date Examples of Validation rule for Text- based columns: Use Operators: =, <>(not equal to), IN In ("Delhi" , "Agra" , "Mumbai") City must be "Delhi" or "Agra" or "Mumbai." =Delhi <> Delhi City can contain only Delhi City cannot contain Delhi

Steps to create a new table using Design View 1. In the database window click Tables tab. 2. Click the New button on the database window toolbar 3. From the New Table dialog box select Design View and click OK. 4. Specify the fields, their data types and properties and save the table. Setting a field as Primary Key 1. Open the table in Design View. 2. Select the field you want to define as the primary key by clicking on the row selector. 3. Right click and choose the primary key option from the shortcut menu. Adding a new field to a table 1. Open the table in Design View 2. Place the cursor on the field above which you want to insert a new field 3. Click Insert -> Rows. A new blank row is added to the table design. You can enter the field name, data types and description. Removing a field from a table 1. Open the table in Design View 2. Select the field which has to be deleted by clicking on the row selector. 3. Press the Delete key or Right click and choose the Delete Rows option. Adding a new record to a table 1. Open the table in Datasheet View 2. Select Insert menu and choose New Record. Deleting Records from a table: 1. Open the table in Datasheet View. 2. Select the record to be deleted by clicking at it. 3. Press the Delete key on the keyboard or click the Delete Record button on the toolbar. 4. Click Yes to confirm deletion.

You might also like