Ism Lab File
Ism Lab File
SUBMITTED BY SUBMITTED TO
[NAME] Dr. Ajay Phogat
Enrollment No: Assistant Professor
BBA (G) V SEM (EVE)
ISM LAB INDEX
10. 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
⮚ S_id
⮚ S_name
⮚ S_course
⮚ S_marks
⮚ S_dob
Make S_id as the primary key and apply the
following validations:
1.S_name should start with A and end with
M.
2.S_course can have only BBA OR MBA as
its values.
3.S_marks, it can be NULL or should be > 50.
4.S_dob should be less than the current date.
Enter at least 10 entries in the table.
• Acc no
• Act type
• Do_opening
• Transaction_type
• Balance
• Account H_name
• Transaction ID
Enter 12 records in the table and perform the
following queries on it.
1. Display the acc no in ascending order.
2. Display the details of account where acc no is
675.
3. Display the details of where acc no is 675 and
name is Nikita.
4. Display the acc no, acc type, account H_name
and balance where balance is greater than
5000.
16. Create a table named as STUDENT with the
following fields as:
● S_no
● Name
● City
● Age
Execute the following queries after entering 10
records in the table.
● Display all the details of the given
table
● Display the names in alphabetical
order
● Display the name along with the
marks where marks are greater than
60
● Display the name of students whose
name starts with letter ‘A’.
● Display the details of students who
live in ‘Delhi’.
● Display the details of students who
are older than 10 years.
GURGAO
2 RAMESH N 9652431543 18
IMPORTANT TERMINOLOGIES
Attribute: Attributes are the properties that define a relation. e.g.; ROLL_NO, NAME
Relation Schema: A relation schema represents name of the relation with its attributes. e.g.;
STUDENT (ROLL_NO, NAME, ADDRESS, PHONE and AGE) is relation schema for
STUDENT. If a schema has more than 1 relation, it is called Relational Schema.
Tuple: Each row in the relation is known as tuple. The above relation contains 4 tuples, one of
which is shown as:
RA
1 M DELHI 9455123451 18
Relation Instance: The set of tuples of a relation at a particular instance of time is called as
relation instance.
Assignment No.- 2
o Text (or VARCHAR): For storing text or string data (e.g., names, addresses).
o Number (or INT): For storing numerical values (e.g., quantities, ages).
o Date/Time: For storing dates and times (e.g., birthdays, order dates).
o Boolean: For storing true/false or yes/no values.
o Currency: For storing monetary values (e.g., product prices).
● Example: FirstName might have a data type of Text, while Salary would have a data type
of Currency or Number.
3. Field Size
● Field Size specifies the maximum amount of data that can be stored in a field. It is
typically used for fields with data types like Text or Number.
o For Text fields, the field size determines how many characters can be stored. For
example, setting a field size of 50 means that the field can hold up to 50
characters.
o For Number fields, the field size controls the range or precision of the numbers
allowed (e.g., whether it's an integer or a floating-point number).
● Example: A Phone Number field might have a field size of 10 to store a 10-digit phone
number.
4. Description
● The Description is an optional text field where you can enter additional details about
the field, such as what the field represents or how it should be used. It’s primarily for
documentation purposes to help users or developers understand the field’s purpose.
o Example: For a field called DOB, the description could be: "Date of Birth of the
customer in MM/DD/YYYY format". This helps clarify how the data should be
entered or interpreted.
Assignment No.- 4
Q. Define data type and explain the various data types available in MS-ACCESS.
Solution-
A data type in a database defines the kind of data that can be stored in a particular field or
column. It specifies how the data will be stored, processed, and retrieved. Each field in a
database table must have a defined data type to ensure consistency and data integrity.
In Microsoft Access, various data types are available to accommodate different kinds of
information such as text, numbers, dates, and more.
Common Data Types Available in Microsoft Access:
1. Short Text
● Description: Used to store alphanumeric data (letters and numbers) with a maximum of
255 characters.
● Example: Names, addresses, phone numbers.
● Use Case: Best for shorter pieces of text such as a person's first name or a city name.
2. Long Text (Memo)
● Description: Stores lengthy text or combinations of text and numbers, with a capacity of
up to 65,536 characters.
● Example: Detailed descriptions, comments, or notes.
● Use Case: Used for storing larger bodies of text, such as a product description or notes
about a customer.
3. Number
● Description: Used to store numerical data. You can specify different number types like
Integer or Decimal.
● Example: Quantities, ages, salaries.
● Use Case: Used for mathematical operations or storing numerical data that doesn’t
involve currency.
4. Large Number
● Description: A 64-bit number that can store much larger numeric values than the
Number data type.
● Example: Used when working with very large numbers.
● Use Case: Suitable for scientific or financial data where larger numbers are needed.
5. Date/Time
● Description: Stores date and time information in a variety of formats.
● Example: Birthdates, order dates, or meeting times.
● Use Case: Ideal for fields that need to record when something happened or when it will
happen.
6. Date/Time Extended
● Description: Provides higher accuracy for date and time data, including support for
fractions of a second.
● Use Case: Useful for applications that require precision with time, such as in scheduling
or timestamps.
7. Currency
● Description: Used to store currency values with up to four decimal places of precision.
● Example: Product prices, salaries.
● Use Case: Designed for monetary data, ensuring precision without rounding errors
typical in floating-point arithmetic.
8. AutoNumber
● Description: Generates a unique sequential or random number automatically for each
new record.
● Example: Invoice numbers, customer IDs.
● Use Case: Commonly used as a primary key for uniquely identifying each record in a
table.
9. Yes/No (Boolean)
● Description: Stores only two values: Yes/No, True/False, or On/Off.
● Example: Active/inactive status, completed/uncompleted tasks.
● Use Case: Suitable for fields that require a simple binary choice, such as whether an item
is available in stock or whether a checkbox is checked.
10. OLE Object
● Description: Stores objects created in other applications (such as images, Word
documents, Excel spreadsheets).
● Example: Embedded images or documents.
● Use Case: Ideal for integrating objects from other applications, but may increase the
database size significantly.
11. Hyperlink
● Description: Stores links to web pages, email addresses, or files.
● Use Case: Useful for fields where you want to store URLs or links to external resources.
12. Attachment
● Description: Stores files, such as images, documents, or spreadsheets, that are attached to
records.
● Example: Product images, PDFs, Excel files.
● Use Case: Efficient for attaching files directly to database records, as it compresses the
attachments automatically.
13. Calculated
● Description: Allows you to store the result of an expression or formula based on other
fields in the same record.
● Example: Price * Quantity = Total Cost.
● Use Case: Great for automatically computing values without having to manually enter
them, such as calculating totals or other derived data.
14. Lookup Wizard
● Description: Helps create a field that uses values from another table or a predefined list
to populate the field.
● Example: Selecting a product name from a list of products.
● Use Case: Ideal for creating dropdown lists that pull values from another table or
predefined options, enhancing data entry consistency.
Assignment No.- 5
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’.
Answer.
Step 1: Open MS Access
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
Assignment No.- 8
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
TABLE 1: STUDENT_DETAILS
Assignment No.- 9
Create table using datasheet view as STUDENT_COURSE with the field name as
● ID
● COURSE CODE
● COURSE NAME.
TABLE 2: STUDENT_COURSE
Assignment No.- 10
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 Access
Text or combinations of text and
only stores the characters entered in a
numbers, such as addresses. Also
field; it does not store space characters for
numbers that do not require
Text unused positions in a Text field. To
calculations, such as phone
control the maximum number of
numbers, part numbers, or postal
characters that can be entered, set the
codes.
FieldSize property.
Lengthy text and numbers, such as
Memo Up to 64,000 characters.
notes or descriptions.
Numeric data to be used for
mathematical calculations, except
calculations involving money (use 1, 2, 4, or 8 bytes. 16 bytes for
Number
Currency type). Set the FieldSize Replication ID (GUID) only.
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 calculations.
Currency 8 bytes.
Accurate to 15 digits to the left of
the decimal point and 4 digits to
the right.
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
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
⮚ 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:
5. Employee names should be in upper case with field size equal to10
6. Set the default value of Emp_dept as HR.
7. Date of joining should be set to the current date by default
8. E_SAL should be in dollars.
Use Lookup Wizard.
Answer.
1. Employee names should be in upper case with field size equal to 10
Output (final)
Assignment No.- 13
ANSWER.
Write steps to put password on the database and convert it into the required format.
Answer.
1. Choose Open from the Office menu.
• Acc no
• Act type
• Do_opening
• Transaction_type
• Balance
• Account H_name
• Transaction ID
Enter 12 records in the table and perform the following queries on it.
• Display the acc no in ascending order.
• Display the details of account where acc no is 675.
• Display the details of where acc no is 675 and name is AJAY.
Display the acc no, acc type, account H_name and balance where balance is greater
than 5000.
5. Now a table would appear. Select the required field via drag and drop. Then click
“Next”. Click on “Finish”.
6. Give the required criteria, i.e., the queries and then click on “run”.
TABLE: ACCOUNT
OUTPUT
OUTPUT
4. Display the acc no, acc type, account H_name and balance where balance is
greater than 5000.
OUTPUT
Assignment No.- 16
Create a table named as STUDENT with the following fields as:
● S_no
● Name
● City
● Age
Execute the following queries after entering 10 records in the table.
● Display all the details of the given table
● Display the names in alphabetical order
● Display the name along with the marks where marks are greater than 60
● Display the name of students whose name starts with letter ‘A’.
● Display the details of students who live in ‘Delhi’.
● Display the details of students who are older than 10 years.
Answer.
Table: Student
● Display the name of students whose name starts with letter ‘A’.
3. Delete the record of the employee whose name begins with S or salary >10000
5. Update the record of the employee, set salary to 15000 where Dept_name is IT.
Assignment No.- 18
Create a table employee with the following fields:
● Emp_id, Emp_name, Contact no, Gender, Salary, Emp_grade,
Designation, Address
Execute the following queries on the table created:
Answer.
Table: Employee
4. Display the details of the employee whose address is D-29, IITM, JANAKPURI.
5. Display the name of the employees whose salary is greater than 10,000.
6. Update the employee details, set EMP_GRADE equal to C whose salary is less than
10000.
CLICK ‘YES’.
7. Delete the record of the employee whose gender is male and designation is manager.
8. Display the name, designation, and salary of all the employees whose names begins
with A.
9. Update the employee details; set designation to assistant manger where designation
is trainee.
Assignment No.- 19
Create a table employee with the following fields:
● Emp_id
● Emp_name
● Dept_name
● Salary
● Address
● Dob
1. Find the employee ids of the employees having same salary.
2. Find the details of the employee working in the same dept.
QUERY2: Find the details of the employee working in the same dept.
QUERY3: Find employee id, emp-name of the employee having same dob.