0% found this document useful (0 votes)
384 views43 pages

ANNU, BBA (GEN), 04721201719, ISM LAB (1) - Compressed

I apologize, there was no question 7 provided in the document. The questions ended at question 6.

Uploaded by

Annu Kashyap
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)
384 views43 pages

ANNU, BBA (GEN), 04721201719, ISM LAB (1) - Compressed

I apologize, there was no question 7 provided in the document. The questions ended at question 6.

Uploaded by

Annu Kashyap
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/ 43

MAHARAJA SURAJMAL

INSTITUTE
INFORMATION MANAGEMENT SYSTEMS BBA 210 LAB FILE

ANNU 04721201719 BBA IV ‘A’ II


ISM LAB FILE

QUES1. What do you mean by ‘Data’, ‘Information’, ‘DBMS’, ‘RDBMS’ and

‘Database’?

1. Data is any sort of information which is stored in computer memory. This

information can later be used for a website, an application or any other client

to store for future purpose. The most common information is User information

in the form of user personal, address and banking information.

2. Database (DB) are organized, they have a structure, and all the data they store

it fits into that structure. More specifically, a database is an electronic system

that allows data to be stored, easily accessed, manipulated and updated.

3. Information is stimuli that have meaning in some context for its receiver. When

information is entered into and stored in a computer, it is generally referred to

as data. After processing (such as formatting and printing), output data can

again be perceived as information.

4. Database Management System (DBMS) is the software that interacts with end

users, applications, and the database itself to capture and analyze the data. The
DBMS software additionally encompasses the core facilities provided to

administer the database. The sum total of the database, the DBMS and the

associated applications can be referred to as a "database system".

5. Relational Database Management System (RDBMS). RDBMS is the basis for

SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle,

MySQL, and Microsoft Access.

A Relational database management system (RDBMS) is a database management

system (DBMS) that is based on the relational model as introduced by E. F. Codd.

S.no DATA DATABASE


1.
It is not properly arranged It is properly organized according to the
I.e. not structured in a proper
need of the user
manner.
i.e. structured and organized
2.
It is the first step It succeeds the data collection step
I.e. collecting data from various I.e. organizing the raw data.
sources.
3. Not ready to use Ready to use.

QUES 2. Write steps to open Microsoft Access. Write steps to create a database.

What are the various elements/objects of a database? What are the various ways to

create tables in database?


Answer.

Steps to open MS- Access:

STEP-1: Click on ‘Windows’.

STEP-2: Click on ‘MS Access’


STEPS TO CREATE DATABASE

STEP-1: Open MS Access

STEP-2: Select blank database

STEP-3: Enter file name and then click create.


ELEMENTS AND OBJECTS OF DATABASE

1) Table

A table is the primary unit of physical storage for data in a database. When a user

accesses the database, a table is usually referenced for the desired data. Multiple

tables might comprise a database; therefore a relationship might exist between

tables. Because tables store data, a table requires physical storage on the host

computer for the database.

Types of table:

 Data tables store most of the data found in a database.

 Join tables are tables used to create a relationship between two tables that

would otherwise be unrelated.

 Subset tables contain a subset of data from a data table.

 Validation tables, often referred to as code tables, are used to validate data
entered into other database tables.

Tables are used to store the data that the user needs to access. Tables might also

have constraints attached to them, which control the data allowed to be entered into

the table. An entity from the business model is eventually converted into a database

table.

2) Columns

A column, or field, is a specific category of information that exists in a table. A column

is to a table what an attribute is to an entity. In other words, when a business model

is converted into a database model, entities become tables and attributes become

columns. A column represents one related part of a table and is the smallest logical

structure of storage in a database. Each column in a table is assigned a data type. The

assigned data type determines what type of values that can populate a column.

When visualizing a table, a column is a vertical structure in the table that contains

values for every row of data associated with a particular column.

3) Rows

A row of data is the collection of all the columns in a table associated with a single

occurrence. Simply speaking, a row of data is a single record in a table. For example, if

there are 25,000 book titles with which a bookstore deals, there will be 25,000

records, or rows of data, in the book titles table once the table is populated. The

number of rows within the table will obviously change as books' titles are added and
removed. See Figure 3 for an illustration of a row of data in a table.

4) Data Types

A data type determines the type of data that can be stored in a database column.

Although many data types are available, three of the most commonly used data types

are

 Alphanumeric

 Numeric

 Date and time

Alphanumeric data types are used to store characters, numbers, special characters, or

nearly any combination. If a numeric value is stored in an alphanumeric field, the

value is treated as a character, not a number. In other words, you should not attempt

to perform arithmetic functions on numeric values stored in alphanumeric fields.

Design techniques such as this will be discussed in more detail throughout the book.

Numeric data types are used to store only numeric values. Date and time data types

are used to store date and time values, which widely vary depending on the relational

database management system (RDBMS) being used.

VARIOUS WAYS TO CREATE TABLE

There are two ways to create:


 Design view

 Datasheet view

DESIGN VIEW

DATASHEET VIEW
QUES 3. What are the features of SQL?

Answer. Following are the features of SQL:

1. Can contain SQL Procedural Language statements and features which

support the implementation of control-flow logic around traditional static

and dynamic SQL statements.

2. Are easy to implement, because they use a simple high-level, strongly typed

language.

3. SQL functions are more reliable than equivalent external functions.

4. Support input parameters.

5. SQL scalar functions return a scalar value.

6. SQL table functions return a table result set.

7. Support a simple, but powerful condition and error-handling model.


8. Allow you to easily access the SQLSTATE and SQLCODE values as special

variables.

9. Reside in the database and are automatically backed up and restored as

part of backup and restore operations.

10.Can be invoked wherever expressions in an SQL statement are supported.

11.Support nested functions calls to other SQL functions or functions

implemented in other languages.

12.Support recursion (when dynamic SQL is used in compiled functions).

13.Can be invoked from triggers.

QUES 4. Write steps to create table in design view and datasheet view.

Answer.

Steps to create database

 Open ms- access

 Select blank database

 Provide 'file name' and then click on create.

DESIGN VIEW

Step 1: Click on ‘View’


Step 2: Select ‘Design View’. The datasheet will open.

Step 3: Enter ‘Field Name’ and ‘Data Type’, as per the data.

DATASHEET VIEW

Step 1: Click on ‘View’

Step 2: Select ‘Datasheet View’. The datasheet will open.

Step 3: Create table on the basis of given data


QUES 5. What do you mean by Field Name, Data type, Field size and Description?

Answer.

Field name:

A field name in Microsoft Access is a piece of information related to a single

person or thing. Related fields are grouped together to form a record. In a

database, where information regarding a company's employee information is

stored, a record would be the information related to a single employee or

group. A field, for example, would be specific information regarding the

employee, perhaps the employee's name, hire date or social security number.

Data type:

A data type is a type of data. Data type is a data storage format that can
contain a specific type or range of values. When computer programs store data

in variables, each variable must be assigned a specific data type. Some

common data types include integers, floating point

numbers, characters, strings, and arrays.

Field Size:

The space for each record in the table. It can be adjusted with the help of “field

size property” of the “number fields” in the table. The size of the record field

which stores the text data can be changed.

Description:

Description is a property that is used to provide information about objects

contained in the Database window as well as about individual table or query

fields. For a database object, click Properties on the view menu and enter the

description text in the Description box. For tables or queries, you can also enter

the description in the table's or query's property sheet.

QUES 6. Write steps to open an existing database?

Answer.

Step 1: Open MS Access


Step 2: On the right side there is a 'open recent database ' and Select the required

database file.

QUES 7. What are the various data types in Database (One line description of

each with example). Create a student database with a table STUDENT_DETAILS

containing the field name as


 ID

 FIRST NAME

 LAST NAME

 AGE

 ADDRESS

Insert 5 records using the design view in MS-ACCESS.

Create another table using datasheet view as STUDENT_COURSE with the field

name as

 ID

 COURSE CODE

 COURSE NAME.

Answer.

VARIOUS DATA TYPES IN DATABASE

Data Type Use For Size

Text or combinations of text Up to 255 characters. Microsoft

and numbers, such as Access only stores the characters


Text
addresses. Also numbers that entered in a field; it does not store

do not require calculations, space characters for unused positions


such as phone numbers, part in a Text field. To control the

numbers, or postal codes. maximum number of characters that

can be entered, set the FieldSize

property.

Lengthy text and numbers, such


Memo Up to 64,000 characters.
as notes or descriptions.

Numeric data to be used for

mathematical calculations,
1, 2, 4, or 8 bytes. 16 bytes for
except calculations involving
Number Replication ID (GUID) only.
money (use Currency type). Set

the FieldSize property to define

the specific Number type.

Date/Time Dates and times. 8 bytes.

Currency values. Use the

Currency data type to prevent

rounding off during


Currency 8 bytes.
calculations. Accurate to 15

digits to the left of the decimal

point and 4 digits to the right.


Unique sequential or random
4 bytes. 16 bytes for Replication ID
AutoNumber numbers automatically inserted
(GUID) only.
when a record is added.

TABLE 1: STUDENT_DETAILS

TABLE 2: STUDENT_COURSE
QUES 8. Write steps to create a database, save the database and open the database.

Create a student database with S1 as table containing the field names as SERIAL NO,

ENROLLMENT NO, NAME, AGE and ADDRESS. Insert at least 10 records using the

design view in MS ACCESS.

Answer.

STEPS TO CREATE DATABASE:

Step 1: Start Access.

Step 2: Click the ‘Blank desktop database’.

Step 3: Type a file name for the database which you want to create.

Step 4: Click on ‘Create’.

STEPS TO SAVE THE DATABASE:

Step1: Open the database or database object.

Step 2: On the ‘File’ tab, click ‘Save As’.

Step 3: Click the format you want to use for the new copy.

STEPS TO OPEN THE DATABASE:

Step 1: Choose File. Click ‘Open’. Open dialogue box will open.

Step 2: Click to select the filename of the database you want to open.

Step 3: Click Open. Access opens the database.

LAYOUT IN DESIGN VIEW


FINAL OUTPUT
QUES 9. Define data type and explain the various data types available in MS-ACCESS.

Create a database DB1 with a table T1 with the following fields as:

 ST_NO.

 ST_ID

 ST_NAME

 ST_ADD

 ST_PHONE NO.

 ST_HOBBIES

In the design view and add at least 10 records in the table.

Answer.

VARIOUS DATA TYPES IN DATABASE

Data Type Use For Size

Up to 255 characters. Microsoft


Text or combinations of text Access only stores the characters
and numbers, such as entered in a field; it does not store
addresses. Also numbers that space characters for unused positions
Text
do not require calculations, in a Text field. To control the
such as phone numbers, part maximum number of characters that
numbers, or postal codes. can be entered, set the FieldSize
property.

Lengthy text and numbers, such


Memo Up to 64,000 characters.
as notes or descriptions.

Numeric data to be used for 1, 2, 4, or 8 bytes. 16 bytes for


Number mathematical calculations, Replication ID (GUID) only.
except calculations involving
money (use Currency type). Set
the FieldSize property to define
the specific Number type.

Date/Time Dates and times. 8 bytes.

Currency values. Use the


Currency data type to prevent
rounding off during
Currency 8 bytes.
calculations. Accurate to 15
digits to the left of the decimal
point and 4 digits to the right.

Unique sequential or random


4 bytes. 16 bytes for Replication ID
AutoNumber numbers automatically inserted
(GUID) only.
when a record is added.

QUES 10. Create a database named EMPLOYEE with the following fields as
EMPLOYEE NAME, EMPLOYEE CODE, EMPLOYEE DESIGNATION, EMPLOYEE

DEPARTMENT, DATE OF JOINING and YEAR OF EXPERIENCE. Delete any two records

as well as fields from the table to show the output.


DELETING 2 RECORDS

Step 1: Select the records which you want to delete. Options will open. Click on

‘Delete Record’
Step 2: A dialogue will open, asking for confirmation.

Step 3: Click on ‘Yes’


Final output

DELETING TWO FIELDS:

Step 1: Select the field which you want to delete. Options will open. Click on

‘Delete Column’
Step 2: A dialogue will open, asking for confirmation.

Step 3: Click on ‘Yes’

FINAL OUTPUT
QUES 11. Create an EMPOYEE database with the following fields as

 Emp_code

 Emp_ssn

 Emp_name

 DOB

 Emp_design

 Emp_dept

 DOJ

 E_SAL

 Years of experience

For the above created database set the following fields properties:
1. Employee names should be in upper case with field size equal to10

2. Set the default value of Emp_dept as HR.

3. Date of joining should be set to the current date by default

4. E_SAL should be in dollars.

Use Lookup Wizard.

Answer.

Employee names should be in upper case with field size equal to 10

Step 1: Open ‘General’ in ‘Design view’.

Step 2: Enter “10” in ‘Field size’. As given in question.


Step 3: Enter “>” in ‘Format’, for upper case

Set the default value of Emp_dept as HR.


Step 1: Open ‘General Wizard’ in ‘Design View’.

Step 2: Type ‘HR’ in ‘Default value’


Date of Birth should be set to the current date by default

Step 1: Open ‘General Wizard’ in ‘Design View’

Step 2: Type ‘=Date()’ in ‘Default value’. For entering current date as default
E-SAL should be in dollars.

Step 1: Open ‘Design View’

Step 2: Select currency in data type of E_SAL

Step 3: In format property select the values with dollar sign


Output (final)
QUES 12. Create an EMPOYEE database with the following fields as:

 Emp_code

 Emp_ssn

 Emp_name

 Emp-dob

For the above created database set the input mask for the field property for

Emp_ssn and Emp_dob using the input mask wizard.

Answer

EMPLOYEE database
EMP_SSN:

Step 1: Select ‘Emp_ssn’ record. In ‘design view’

Step 2: In “Input Mask’’ of ‘General Field Properties’, click for opening ‘Input

Mask Wizard’

Step 3: In ‘Input Mask Wizard’. Select ‘PASSWORD’. Click ‘Next’.

Step 4: Click ‘Next’. Then click on ‘Finish’.

The input mask will show the change made. The number will be stored in Database

view, according to the ‘Input Mask’.


EMP_DOB:

Step 1: Select ‘Emp_dob’ record. In ‘design view’

Step 2: In “Input Mask’’ of ‘General Field Properties’, click for opening ‘Input

Mask Wizard’.

Step 3: In ‘Input Mask Wizard’. Select ‘Short Date’. Then click ‘Next’.
Step 4: Select ‘How to store data?’ and click ‘Next’. Click on ‘Finish’

The input mask will show the change made. The number will be stored in Database

view, according to the ‘Input Mask’.


QUES 13. Create a database named as STUDENT DATABASE. With a table

STUDENT_DETAILS with the given fields as

 St_id

 St_roll no.

 St_name

 St_age

 St_dob

 St_course

 St_add

 St_contact

 St_phone no.

Add at least 10 records in the table. Answer the following:

A. What is a primary key? Make a field stu_id as the primary key in the

table. Also write down the steps for the same.

B. What is a composite key? In the table STUDENT_DETAILS, make stu_roll

no and st_dob as a composite key also write the steps for the same.

Answer.

STUDENT DATABASE
A. Primary Key: A primary key is a field in a table which uniquely identifies each

row/record in a database table. Primary keys must contain unique values. A primary

key column cannot have NULL values. A table can have only one primary key, which

may consist of single or multiple fields.

Make a field ‘stu_id’ as the primary key in the table.

Step 1: Select the ‘stu_id’ record. Right click, options will be shown.
Step 2: Select ‘Primary Key’. A key sign will be shown in front of ‘stu_id’.

Composite Key: A composite key is a combination of two or more columns in a table


that can be used to uniquely identify each row in the table when the columns are

combined uniqueness is guaranteed, but when it taken individually it does not

guarantee uniqueness.

In the table STUDENT_DETAILS, make stu_roll no and st_dob as a composite key

Step 1: Select the ‘stu_roll no’ and ‘st_dob’ record. Right click, options will be

shown.

Step 2: Select ‘Primary Key’. A key sign will be shown in front of ‘stu_roll no’

and ‘st_dob’.

You might also like