0% found this document useful (0 votes)
221 views133 pages

Adreeja Lab File Ism

This document contains a lesson plan for an Information Systems Management lab course. It lists 18 programs to be covered on various dates, including defining database concepts, creating databases and tables in Microsoft Access, adding and querying data, and establishing relationships between tables. Students will learn to create databases to store student, employee, account and customer data, as well as perform queries to select, filter, sort and group records. The lesson plan aims to teach skills for building and querying databases in MS Access.

Uploaded by

tushar rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
221 views133 pages

Adreeja Lab File Ism

This document contains a lesson plan for an Information Systems Management lab course. It lists 18 programs to be covered on various dates, including defining database concepts, creating databases and tables in Microsoft Access, adding and querying data, and establishing relationships between tables. Students will learn to create databases to store student, employee, account and customer data, as well as perform queries to select, filter, sort and group records. The lesson plan aims to teach skills for building and querying databases in MS Access.

Uploaded by

tushar rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 133

Practical File

Information Systems Management

Bachelor of Commerce (Hons.)

B.Com (Hons)-V
(Paper Code -307)

Guru Gobind Singh Indraprastha University, Delhi

Submitted To: Submitted By:


Ms. Ankita Gupta Student’s Name: Adreeja Dutta Chowdhury
Ms. Sheetal Kaushik Enrollment No: 01721188819

Institute of Information Technology & Management,


New Delhi – 1100 58
Batch (2018-2021)

INSTITUTE OF INFORMATION TECHNOLOGY AND MANAGEMENT NEW DELHI


(Affiliated to GGSIP University)

LESSON PLAN-Information System Management lab

PROGRAMME: B.COM(H) SEMESTER: V PAPER CODE: 307 ACADEMIC SESSION: 2021-22

S. No List of Programs Date Faculty sign

Define Data, Information, Database, DBMS and 17/08


1
RDBMS.
Give steps to Open Microsoft Access. Write steps to 17/08
create a database. What are the various elements/objects of
2 a database? What are the various ways to create tables in
database?

Features of SQL. 17/08


3

Give the steps to create table in design view and datasheet 17/08
4 view.
Explain Field Name, Data Types, Field Size with its 17/08
5 Description.

Give the steps to open an existing database. 17/08


6

Various data types in Database. Create a student 19/08


database with a table STUDENT_DETAILS containing
the field name as

 ID
 FIRST NAME
 LAST NAME
 AGE
 ADDRESS

7 Insert 5 records using the design view in MS-


ACCESS.

Create another table using data sheet view


as STUDENT_COURSE with the field name as
 ID
 COURSE CODE
 COURSE NAME.

Enter 5 records.

Steps to create a database, save the database and open the 19/08
database. Create a student database with S1 as table
8 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.
S. No List of Programs Date Faculty sign

Define data type and explain the various data types 19/08
available in MS-ACCESS. Create a database DB1 with a
table T1 with the following fields as:
 ST_NO.
 ST_ID
9  ST_NAME
 ST_ADD
 ST_PHONE NO.
 ST_HOBBIES
In the design view and add at least 10 records in the table.

Create a database named EMPLOYEE with the 19/08


following fields as EMPLOYEE NAME, EMPLOYEE
CODE, EMPLOYEE
10 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.
Create an EMPOYEE database with the following fields 19/08
as
 Emp_code
 Emp_ssn
 Emp_name
 DOB
 Emp_design
 Emp_dept
 DOJ
 E_SAL
11  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.
Create an EMPOYEE database with the following fields 24/08
as:
 Emp_code
 Emp_ssn
12
 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.
Create a table as STUDENT_DETAILS with the 24/08
following fields
 S_id
 S_name
 S_course
 S_marks
 S_dob
13 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.
Note
LIKE “*A”
LIKE “A*”
LIKE “A*B”
LIKE”*A*”
Create a local template of “FACULTY” , insert 5 records 26/08
and perform the following queries on faculty template
table:

a. Insert five records using “new faculty” tab in faculty


template.
b. Faculty name should be in ascending order.
14
c. Department should be in descending order
d. Generate report for: All faculty category and faculty by
department category.

Create a database named as STUDENT DATABASE 31/08/2021


with a table STUDENT_DETAILS having fields as
 St_id
 St_roll no.
 St_name
 St-age
 St-dob
 St_course
 St-add
 St_contact
15
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 stu-dob as a composite key also
write the steps for the same.
Create a company database with the following table 04/09/2021
EMP_DETAILS with the fields as:
 EMP_ID
 EMP_NAME
 EMP_DESIGNATION
And make EMP_ID as the primary key.
Create another table as DEPT_DETAILS with the fields
as:
 DEPT_ID
 DEPT_NAME
16  DEPT_LOCATION
Also create a table as PROJECTS with fields as:
 P_ID
 P_NAME
Designate primary key in both the fields. Establish a
relationship between the table
EMP- DETAILS AND
DEPT_DETAILS AS 1:1, 1: M and M:
1. Also enforce referential integrity constraint on it and
write down the steps for the same.
Explain in brief about the query object in MS- ACCESS 07/09/2021
2007. Write steps to execute queries using the query
wizard. Create an ACCOUNT table with the following
fields:
• Acc no
• Act type
• Do_opening
• Transaction_type
• Balance
• Account H_name
17(a)
• 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.
Create a table Student with following fields 09/09/2021
• Enrolment_no
• S_name
• Course_id
• Batch
• Semester
Execute the following queries after entering 10
17(b)
records in the table.
• Display the list of Students in batch ‘2017-2020’
• Display the Enrolment_no of fourth semester
students.
• Display the list of students of batch ‘2019-2022’ and
course_is 17.
Display the number of students in course_id 44.
Create the following table CUSTOMER having the 09/09/2021
columns, data types.
Field Name Data Type
Customer_ID Number
Customer_Name Text
Designation Text
City Text
Country Text
Phone Number
18(a) Insert the data into table Customer. And apply the
queries:
 Display customer details having designation Sales
Representative.
 Retrieve customer who is living in Canada.
 Show details of the customer whose name is
Victoria.
Show detail of the customer who lives in Sweden. Show
detail of the customer who is owner.
Create a table named as STUDENT with the following fields 14/09/21
as:
 S_no
 Name
 City
 Age
 Marks
Execute the following queries after entering 10 records in
18(b) 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.

18(c) Create a table employee with the following fields: 16/9/2021


Emp_id
Emp_name
Contact no.
Gender
Salary
Emp_grade
Designation
Address
Execute the following queries on the table created:
1. Display the details of the employees
2. Display the employee id of employee whose name is
supriya.
3. Display the name of the employee whose contact no.
is 98454863011.
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.
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.
10. Display the employee id, name, salary and
designation for the employees where emp_grade is A.

19(a) Create a table EMPLOYEE either the following fields: 16/09/21


Emp_id
Emp_name
Dept_name
Salary
Add
Date of joining
Perform the following queries on it.
1. Delete the records of the employee whose Emp_id
is 101
2. Delete the record of the employees whose
Dept_name is HR and salary >10000
3. Delete the record of the employee whose name
begins with S or salary >10000
4. Update the record of the employees, set
Dept_name = IT where Dept_name is
PRODUCTION.
5. Update the record of the employee, set salary to
15000 where Dept_name is IT.

Create a table EMPLOYEE either the following fields: 21/09


•Emp_id
•Emp_name
•Dept_name
•Salary
•Add
•Date of joining
Perform the following queries on it.
1. Delete the records of the employee whose
Emp_id is 101
19(b)
2. Delete the record of the employees whose
Dept_name is HR and salary >10000
3. Delete the record of the employee whose name
begins with S or salary >10000
4. Update the record of the employees, set
Dept_name = IT where Dept_name is
PRODUCTION.
Update the record of the employee, set salary to
15000 where Dept_name is IT.
Create a table named as STUDENT_MARKS with the 21/09
following fields as:
 S_no
 Name
 Marks
Execute the following queries after entering 10 records in
the table.
1. Display the S_no of those students whose names
start with L and ends with A or marks less than 70.
2. Display the name and S_no of those students who
19(c) have scored marks equal to 95.
3. Display the names and marks of all those students
who have scored marks between 75 and 90.
Write SQL Queries using Data Manipulation Commands Insert 23/09
record into Table named Employee with Fields
 EMP_ID
 EMP_NAME
 EMP_DESIGNATION
 EMP_AGE
 EMP_DEPARTMENT
 EMP_SALARY
20 And make EMP_ID as the primary key.
1. Write a query to find the salary of a person where age is
<= 26 and salary >= 25000 from Employee Table.
2. Write a query to find the name of Employee whose name
is like “Ku%”.
3. Write a query to find the customer details using “IN” and
“Between” operator where age can be 25 or 27.
Create a table employee with the following 26/10/2021
fields:
 Emp_id
 Emp_name
 Dept_name
 Salary
 Address
 Dob
21
1. Find the employee ids of the employees
having same salary.
2. Find the details of the employee working in
the same dept.
3. Find employee id, emp-name of the
employee having same dob.

Discuss All DDL Commands with its syntax. 14/10/2021


22
Write SQL Queries using Data Definition Commands 14/10/2021
like CREATE, DROP, TRUNCATE, RENAME,
23 ALTER.
Create Table named Student with Fields Student id,
Name, Age, Course, Fees.
And apply above mentioned commands on the table.

Discuss All DML Commands with its syntax. 12/10/2021


24
Define All Aggregate function with its work defined in 12/10/2021
SQL.

25

26 Describe the concept of Forms in MS-Access. 26/10/21

27 Create two tables EMPLOYEE and DEPARTMENT with 26/10/21


the following fields:
1. EMPLOYEE
 F_NAME
 L_NAME
 E_ID
 DOB
 ADDRESS
 SALARY
2. DEPARTMENT
 D_NO
 D_NAME
 MGR_NO
 MGR-DOJ
Create the forms for the employee as well as the dept table
in tabular form and write the steps to create the forms. Also
provide the suitable title to both the forms and insert the
page no’s to it.

Create a table named STUDENT_DETAILS with the 9/11/21


following fields:
 R_no
 Name
 Course name
 Attendance
 Dob
 Address
28 Course will have values either ISM or FMI. Enter 5
records. Create a form for the above table in design view.
Add text box and the following buttons to it:
 Go to first record
 Go to last record
 Go to previous record
 Go to next record Add a
label student form to it.
29 Create a table named as BBA_M1 with the following 16/11/21
fields:
 E_no
 Student name
 Address
 Phone no
 Grade
Now create another table named as BBA_M2 with the
same fields. Add at least 10 records to the table
BBA_M1 (with first 10 enrollment no’s and BBA_M2
with next 10 e_no) and then perform the following
queries on it.
 Create a make table query which contains the A
grade students from BBA_M1
 Append the A grade holders from BBA_M2 to
the newly created table in the above query.

Write SQL Queries using SQL Commands Create a 9/11/21


Table Product with Fields
 PRO_ID
 PRO_NAME
 PRO_PRICE
And make PRO_ID as the primary key. Insert 10
30 Records into the Table.

1. Write a query to find the Name of Product where


PRO_PRICE>= 500 from PRODUCT Table.
2. Write a query to implement Aggregate Functions on
field PRICE”.
3. Write a query to COUNT the number of Records in the
Product Table.
Create an ER Diagram for COLLEGE Management 16/11/21
31 system.

Create an ER Diagram for Airline Reservation System. 16/11/21


32

Create an ER Diagram for Employee Management 18/11/21


33 System

18/11/21
34 Create an ER Diagram for Library Management system
Assignment 1
Ques. What do you mean by Data, Information, Database, DBMS, RDBMS?
Ans. Data
Data can be defined as a representation of facts, concepts, or instructions in a formalized
manner, which should be suitable for communication, interpretation, or processing by human
or electronic machine. In general concept, data refers to the fact that some existing
information or knowledge is represented in some form which can be suitable for better usage
and processing. Raw data is a collection of numbers or characters before it is corrected. Data
processing commonly occurs by stages, and the "processed data" from one stage may be
considered the "raw data" of the next stage. Data are measured, collected and reported and
analysed. I can be visualized using graphs, tables, images, or other analysis tool.
Information
Information is organized or classified data, which has some meaningful values for the
receiver. Information is the processed data on which decisions and actions are based . It is
associated with data, as data represent values attributed to parameters and information is data
in context and with meaning attached. Information also relates to knowledge, as knowledge
signifies understanding of an abstract or concrete concept.
Database
A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database
management system (DBMS). Together, the data and the DBMS, along with the applications
that are associated with them, are referred to as a database system, often shortened to just
database.
Data within the most common types of databases in operation today is typically modelled in
rows and columns in a series of tables to make processing and data querying efficient. The
data can then be easily accessed, managed, modified, updated, controlled, and organized.
Most databases use structured query language (SQL) for writing and querying data.
DBMS
Database management system (DBMS) is a software for storing and retrieving users' data
while considering appropriate security measures. It consists of a group of programs which
manipulate the database. The DBMS accepts the request for data from an application and
instructs the operating system to provide the specific data. In large systems, a DBMS helps
users and other third-party software to store and retrieve data.
DBMS allows users to create their own databases as per their requirement. The term
“DBMS” includes the user of the database and other application programs. It provides an
interface between the data and the software application.
RDBMS

A relational database management system (RDBMS) is a collection of programs and


capabilities that enable IT teams and others to create, update, administer and otherwise
interact with a relational database. RDBMS store data in the form of tables, with most
commercial relational database management systems using Structured Query
Language (SQL) to access the database. However, since SQL was invented after the initial
development of the relational model, it is not necessary for RDBMS use.
The RDBMS is the most popular database system among organizations across the world. It
provides a dependable method of storing and retrieving large amounts of data while offering
a combination of system performance and ease of implementation
ASSIGNMENT 2
Ques. 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?
Steps to open Microsoft Access
 Click on the start button then on all programs
 After that click on the Microsoft office and choose the option of Microsoft Access

 Another step to open the Microsoft Access is click on the run function and type “ms-
access” and click “ok”
 Right click on the mouse and click on to “new”, then another box will get opened
where you can see the Microsoft Access option. Click on that and the Microsoft
Access will get started.
Steps to open a database
In order to open a database, follow the following steps:
 when you open the access, there will display an option of new
 click on the new tab or can use the blank database

Objects of Database
MS Access uses “objects" to help the user list and organize information, as well as prepare
specially designed reports. There are four major objects of Database.
 Tables
 Queries
 Forms
 Reports
These objects allow us to enter, store, analyse and compile data.
Tables
Table is an object that is used to define and store data. When you create a new table, Access
asks you to define fields which is also known as column headings.
 Each field must have a unique name, and data type.
 Tables contain fields or columns that store different kinds of data, such as a name or
an address, and records or rows that collect all the information about a particular
instance of the subject, such as all the information about a customer or employee etc.
 You can define a primary key, one or more fields that have a unique value for each
record, and one or more indexes on each table to help retrieve your data more
quickly.
Queries
An object that provides a custom view of data from one or more tables. Queries are a way of
searching for and compiling data from one or more tables.
 Running a query is like asking a detailed question of your database.
 When you build a query in Access, you are defining specific search conditions to find
exactly the data you want.
 In Access, you can use the graphical query by example facility or you can write
Structured Query Language (SQL) statements to create your queries.
 You can define queries to Select, Update, Insert, or Delete data.
 You can also define queries that create new tables from data in one or more existing
tables.
Form
Form is an object in a desktop database designed primarily for data input or display or for
control of application execution. You use forms to customize the presentation of data that
your application extracts from queries or tables.
 Forms are used for entering, modifying, and viewing records.
 The reason forms are used so often is that they are an easy way to guide people
toward entering data correctly.
 When you enter information into a form in Access, the data goes exactly where the
database designer wants it to go in one or more related tables.
Reports
Report is an object in desktop databases designed for formatting, calculating, printing, and
summarizing selected data.
 You can view a report on your screen before you print it.
 If forms are for input purposes, then reports are for output.
 Anything you plan to print deserves a report, whether it is a list of names and
addresses, a financial summary for a period, or a set of mailing labels.
 Reports are useful because they allow you to present components of your database in
an easy-to-read format.
 You can even customize a report's appearance to make it visually appealing.
 Access offers you the ability to create a report from any table or query.

Other database objects other than these four are macros and modules.

Creating tables in database


In a database the data are stored in the form of tables because the database objects heavily
depend the tables. Tables can be created by using database view and design view.
Creating a table using Database view
 After opening a new database or a blank database, the Access automatically opens up
a table in datasheet view.

 When you go to the field tab you can see that it is also automatically created. The ID
which is an AutoNumber field acts as our unique identifier and is the primary key for
this table. The ID field has already been created and we now want to rename it to suit
our conditions.
 Click on the “name and caption” option in the ribbon in order to change or rename
the field. When you click on it a dialog box will appear.

1. By clicking on the “click to add” option you add fields to the table. Choose Short
Text as the field. When you choose short text, Access will then highlight that field
name automatically and all you have to do is type the field name.
2. Now type on the field names that you are required.

3. Once all the icons are added click on the save icon in order to save the data. Enter the
name of the table and click OK.
Creating a table using Design view
4. In the tables group, click on Table and you can see that it looks completely different
from the Datasheet View. In this view, you can see the field name and data type side
by side.
5. Then you have to fill data in the field and have to mention the type of data.

6. After entering the data click on the save icon in order to save the data.
ASSIGNMENT 3
Ques. Write features of SQL.
Ans. SQL is Structured Query Language, which is a computer language for storing,
manipulating and retrieving data stored in a relational database.
SQL is the standard language for Relational Database System. All the Relational Database
Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix,
Postgres and SQL Server use SQL as their standard database language.
Data Definition Language (DDL)
A Data Definition Language (DDL) is a computer language used to create and modify the
structure of database objects in a database. These database objects include views, schemas,
tables, indexes, etc. This term is also known as Data Description Language in some
contexts, as it describes the fields and records in a database table.
There are three commonly used command in DDL. They are:
7. CREATE: This command builds a new table and has a predefined syntax. The
CREATE statement syntax is:
CREATE TABLE [table name] ([column definitions]) [table parameters]

8. ALTER: An ALTER command modifies an existing database table. This command


can add up additional column, drop existing columns and even change the data type
of columns involved in a database table. The ALTER statement syntax is:
ALTER TABLE [table name] ([column name]) [data type]

9. DROP: A drop command deletes a table, index or view. Drop statement syntax is:
DROP [table name/object name]

10. TRUNCATE: This command is used to remove all records from a table,
including all spaces allocated for records are removed. The TRUNCATE
statement syntax is:
TRUNCATE TABLE [table name]

11. RENAME: It is used to rename the objects. The RENAME statement syntax is:
RENAME TO new table name or
RENAME old name to new name
Data Query Language (DQL)
Data Query Language (DQL) refers to any computer programming language that request and
retrieves data from database and information systems by sending queries. It works on user
entered structured and formal programming command-based queries to find and extract data
from host databases.
The command used in DQL is:
12. SELECT: This command is used to retrieve data from the database table. The
SELECT statement syntax is:
SELECT [column 1, column 2] FROM [table name] or
SELECT *FROM [table name]
Data Manipulation Language (DML)
The commands of SQL that are used to insert data into the database, modify the data of the
database and to delete data from the database are collectively called as DML. Examples
include insert, update and delete.
The commands of DML are:
13. INSERT: To insert data into a table. The INSER statement syntax is:
INSERT INTO table name (column 1, column 2.…column N) VALUES (value 1,
value 2….value N)

14. UPDATE: To update the existing data in a table. The UPDATE statement syntax is:
UPDATE (table name) SET (column name) = (new value) WHERE (some
condition)

15. DELETE: This command is used to delete all the records from a table. The DELETE
statement syntax is:
DELETE FROM (table name) WHERE condition
ASSIGNMENT 4
Ques. Write steps to create a table in design view and datasheet view.
Ans. In a database the data are stored in the form of tables because the database objects
heavily depend the tables. Tables can be created by using database view and design view.
Datasheet view
A web datasheet view in an Access app displays online data arranged in rows and columns in
a web browser. It can allow data edits or not, as you prefer.
When you create a web datasheet view in Access, it opens in Design View, where you can do
any of the following:
16. Set the record source
17. Provide a caption for the view
18. Add automatic actions that happen when the view opens and when someone moves
between records using the view
19. Add custom actions that happen when someone clicks a button
20. Resize and move controls and set control properties
Creating a table in datasheet view
 After opening a new database or a blank database, the Access automatically opens up
a table in datasheet view.

 When you go to the field tab you can see that it is also automatically created. The ID
which is an AutoNumber field acts as our unique identifier and is the primary key for
this table. The ID field has already been created and we now want to rename it to suit
our conditions.
 Click on the “name and caption” option in the ribbon in order to change or rename
the field. When you click on it a dialog box will appear.
21. By clicking on the “click to add” option you add fields to the table. Choose Short
Text as the field. When you choose short text, Access will then highlight that field
name automatically and all you have to do is type the field name.

22. Now type on the field names that you are required.

23. Once all the icons are added click on the save icon in order to save the data. Enter the
name of the table and click OK.
Design view
Most Access objects are displayed in Design view, which allows you to work with the
underlying structure of your tables, queries, forms, and reports. To create a new table in
Design view, you define the fields that will comprise the table before you enter any data. In
Design view for tables, each row corresponds to a field. You can edit, insert, and delete
fields in your database tables in Design view. You insert a field by adding a row, while you
delete a field by removing a row. You can also change field order by dragging a row selector
to a new position.
Creating a table in design view
24. In the tables group, click on Table and you can see that it looks completely different
from the Datasheet View. In this view, you can see the field name and data type side
by side.
25. Then you have to fill data in the field and have to mention the type of data.

26. After entering the data click on the save icon in order to save the data.
Difference

Datasheet View is a representation of the data in a database. Using this view, it is possible to
edit the data in the database. However, only minor changes can be made to the actual
database format. One such change that can be made to the format is adjusting the column
width of a table.
Design View helps with modifying the database format. Changes can be made to forms,
tables, or other database objects. Fields can also be configured to set appropriate keys and
restrictions on type of data entered in them. However, the actual data in the database cannot
be manipulated using this view.

ASSIGNMENT 5
Ques. What do you mean by field name, data type, field size, and description?
Ans. Field name
A field in Microsoft Access is a piece of information related to a single person or thing.
Related fields are grouped together to form a record. When you add a field by entering data in
Datasheet view, Access automatically assigns a generic name to the field. Access assigns the
name Field1 to the first new field, Field2 to the second new field, and so on. By default, a
field's name is used as its label wherever the field is displayed, such as a column heading on a
datasheet. Renaming fields so that they have more descriptive names helps make them easier
to use when you view or edit records.

Data type
Every field in a table has properties and these properties define the field's characteristics and
behaviour. The most important property for a field is its data type. A field's data type
determines what kind of data it can store. MS Access supports different types of data, each
with a specific purpose.
 The data type determines the kind of the values that users can store in any given field.
 Each field can store data consisting of only a single data type.

The most commonly used data types are:

Data type Description Size

Text or combinations of text and numbers, Up to 255 characters.


Short Text including numbers that do not require calculating
(e.g. phone numbers).

Long Text Lengthy text or combinations of text and Up to 63, 999


numbers. characters.
Numeric data used in mathematical calculations. 1, 2, 4, or 8 bytes (16
Number bytes if set to
Replication ID).

Date and time values for the years 100 through 8 bytes
Date/Time
9999.

Currency values and numeric data used in 8 bytes


Currency mathematical calculations involving data with
one to four decimal places.

A unique sequential (incremented by 1) number 4 bytes (16 bytes if set


AutoNumbe
or random number assigned by Microsoft Access to Replication ID).
r
whenever a new record is added to a table.

Yes and No values and fields that contain only 1 bit.


Yes/No one of two values (Yes/No, True/False, or
on/Off).

Field size
The field's data type determines which other properties that you can set. he Field
Size property is especially important, because it determines the range of field values.
The Field Size property also determines how much disk space each Number field value
requires. Depending on the field size, the number can use exactly 1, 2, 4, 8, 12, or 16 bytes.

Description
The Description property is used to provide information about objects contained in the
Database window as well as about individual table or query fields. An object's description
appears next to the object's name in the Database window when you click Details on
the View menu.
ASSIGNMENT 6
Ques. Write steps to open an existing database.
Ans. If Access is already running, use the following procedure to open a database. Note, the
steps vary slightly depending upon your version of Access.
1. On the getting started page of Access, Click Open Other Files.
2. On the Open area of the Backstage view, click Browse.
3. Click a shortcut in the Open dialog box, or in the Look in box, click the drive or folder that
contains the database that you want.
4. In the folder list, browse to the folder that contains the database.
5. Then click on the database that is wanted to be opened.

ASSIGNMENT 7
Ques. Create a student database with a table Student-Details containing the fields
names as ID, First name, Last name, Age, Address. Insert 5 records using the design
view. Create another table using data sheet view
as STUDENT_COURSE with the field name as
• ID
• COURSE CODE
• COURSE NAME.
Enter 5 records.
Ans. In order to create a Student table the following steps are to be followed:
1. Open a new blank database in MS Access and name it as Student.
2. After opening a new database or a blank database, the Access automatically opens up
a table in datasheet view.
3. Rename the table as Student_Details.
4. After that enter the field names and data type that is needed in the design view of the
database and save it.

5. Then go to the datasheet view and fill all the information required, after which save
the database.

6. Add another table and Rename the table as Student_course

7. and fill all the information required, after which save the database.
ASSIGNMENT 8
Ques. Create a Student_Data with S1 as the table name containing the filed names as
Enrolment_no, name, age, date_of_birth, phone_no, email_id, address. Insert at least
10 records.
Ans. Steps to create a student data database are as follows:
1. Open a blank database and name it as Student_data.
2. After opening a new database or a blank database, the Access automatically opens up
a table in datasheet view.
3. Rename the table as S1.
4. After that enter the field names and data type that is needed in the design view of the
database and save it.
5. After completing the table go to the save icon and save the database.

ASSIGNMENT 9
Ques: 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.
Steps to create a student data database are as follows:
1. Open a blank database and name it as Student_data.
2. After opening a new database or a blank database, the Access automatically opens up
a table in datasheet view.
3. Rename the table as T1.
4. After that enter the field names and data type that is needed in the design view of the
database and save it.
5. After completing the table go to the save icon and save the database.
ASSIGNMENT 10
Ques. Create a database named EMPLOYEE and create a table named
EMPLOYEE_DATA with the following fields as EMPLOYEE_ID,
EMPLOYEE_NAME, SSN_NO, EMPLOYEE_DESIGNATION,
EMPLOYEE_DEPARTMENT, DATE_OF_JOINING, SALARY and
YEAR_OF_EXPERIENCE. Insert 10 records and delete any two records and one field
(i.e., SSN_NO) from the table to show the output.
Ans. Steps to delete record
The deletion process is fairly simple, except when the record is related to other data and
resides on the "one" side of a one-to-many relationship. To maintain data integrity, by
default, Access does not let you to delete related data.
1. Open the table in Datasheet View or form in Form View.
2. Select the record or records that you want to delete.
To select a record, click the record selector next to the record, if the record selector is
available.
To extend or reduce the selection, drag the record selector (if it is available), or press
SHIFT+DOWN ARROW or SHIFT+UP ARROW.
3. Press DELETE, select Home > Records > Delete, or press Ctrl+Minus Sign (-).

Steps to delete a field


1. To delete a table field in Access, open the table that contains the field to delete in
design view.
2. Click the row selector of the row that you wish to delete.
3. Click the “Delete Rows” button in the “Tools” group on the “Design” tab of the
“Table Tools” contextual tab in the Ribbon.
4. A pop-up dialog box will appear, asking you if you really want to delete this field.
Click “Yes” to delete the field and all of its data.
5. Click the “Save” button in the Quick Access toolbar to save your structural
modifications.
ASSIGNMENT 11
Ques. Create an Employee 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 field properties:
1. Employee names should be in upper case with field size equal to 10
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 Euro
Use lookup wizard.

Ans. 1. Employee names should be in upper case with field size equal to 10
Step 1: Open General in Design view
Step 2: Enter “>” in ‘Format’ for upper case
Step 3: Enter “10” in ‘Field size’.

2. Set the default value of Emp_dept as HR


Step 1: Open ‘General wizard’ in ‘Design view’.
Step 2: Type ‘HR’ in the ‘ default value’.
3. Date of joining should be set to the current date by default
Step 1: Open ‘General wizard’ in ‘Design view’.
Step 2: Type ‘=Date()’ in the ‘Design view’. For entering current date as default.

4. Employees salary should be in Euro


Step 1: Open ‘Design view’
Step 2: Select the currency in the data type of the salary field
Step 3: In the format property select the value with the currency sign required.
ASSIGNMENT 12
Ques. Create an Employee database with the following fields as:
 Employee_code
 Employee_SSN
 Employee_name
 Employee_DOB
For the above created database set the input mask for the field property
for Employee_SSN and Employee_DOB using the input mask wizard.
Ans. The Input Mask Wizard to create an input mask. An input mask is a set of simple rules
that specifies the format in which data can be entered into a field.

Create an Employee database and create a table in the name of Employee_Data.

Input mask property on the Employee_SSN


1. Go to the design view and enter the fields required. Select the Employee_SSN
field and go to the general properties.
2. Click on the Input Mask Wizard and select the option of social security number.
Put on the input mask and placeholder symbol.
3. Click on the finish option.
If social security number is not available in the input mask wizard then click on the
edit list option and edit it by putting a 9-digit code which is there in the wizard by
default and a placeholder symbol.

Input mask property on the Employee_DOB


1. Go to the design view and select the Employee_DOB. Then click on the input
mask option in the general properties.
2. Click on one of the options required and put on the placeholder symbol and click
finish.
ASSIGNMENT 13
Ques. Create a table as Student_details with the following field:
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
3. S_marks can be NULL or should be >50
4. S_dob should be less than the current date
Enter 10 records in the table.
Ans. Create a database with a Student_details as the table name.
1. S_name should start with A and end with M
In the design view select the S_name field and then write Like” A or M” in the validation
rule in the general properties.

If wrongly entered the MS access will detect the error.

2. S_course can only have BBA or MBA


Go to the general properties in the design view, select the S_course field and write
“BBA or MBA” in the validation rule.

If wrongly entered the MS access will detect the error.

3. S_marks should be Null or less than 50


Select S_marks field in the design view and write Is Null or > 50 in the validation
rule in the general properties.

If wrongly entered the MS access will detect the error.

4. S_dob should be less than the current date


In the general properties of the S_dob field in the design view, write <# Current date#
in the validation rule.
If wrongly entered the MS access will detect the error.
ASSIGNMENT 14

Ques: Create a local template of “FACULTY” , insert 5 records and perform the
following queries on faculty template table:

a. Insert five records using “new faculty” tab in faculty template.


b. Faculty name should be in ascending order.
c. Department should be in descending order
d. Generate report for: All faculty category and faculty by department category.

1. Open ms access and select faculty database

2. Rename the table as faculty list and start entering the values.

3. . Faculty name should be in ascending order.


4. . Department should be in descending order

5. Generate report for: All faculty category and faculty by department category
ASSIGNMENT 15
Ques. Create a database named as Student Database. With a table Student_Details with
the given fields as:
 Stu_id
 Stu_roll
 Stu_name
 Stu_age
 Stu_dob
 Stu_course
 Stu_add
 Stu_contact
Add at least 10 records in the table. Answer the following:
1. What is a primary key? Make a field Stu_id as the primary key in the table.
Also write the steps for the same.
2. What is a composite key? In the table male Stu_roll and stu_dob as the
composite key and write the steps for the same.
Ans. Student_details table

Primary key
A primary key is a special relational database table column (or combination of columns)
designated to uniquely identify each table record.
A primary key is used as a unique identifier to quickly parse data within the table. A table
cannot have more than one primary key.
A primary key’s main features are:
 It must contain a unique value for each row of data.
 It cannot contain null values.
 Every row must have a primary key value.
A primary key might use one or more fields already present in the underlying data model, or
a specific extra field can be created to be the primary key.
Steps to create a primary key
1. Go to the design view and select the Stu_id.
2. Right click on the mouse and click on the primary key option.
OR
1. Go to the design view and select the Stu_id.
2. Click on the primary key option on the ribbon bar.
since the primary key is an unique function, therefore, the Access will detect the error when
recorded a same ID in the Stu_id field.

Composite key
A composite key, in the context of relational databases, is a combination of two or more
columns in a table that can be used to uniquely identify each row in the table. Uniqueness is
only guaranteed when the columns are combined; when taken individually the columns do
not guarantee uniqueness.
Steps
1. In the design view select the roll number and Stu_dob.
2. Either right click or choose the primary key from the ribbon bar, in order to make
both of them unique.
ASSIGNMENT 16
QUES: Create a company database with the following table Emp_details with the fields
as:
 Emp_ID
 Emp_name
 Emp_designation
And make Emp_ID as the primary key. Create another table as Dept_details with the
fields as:
 Dept_ID
 Dept_name
 Dept_location
Also create a table as Projects with the fields as:
 P_ID
 P_name
Designate primary key in all the tables. Establish a relationship between the table
Emp_details and Dept_details as 1:1, 1:M and M:1. Also, establish a relationship
between the table Emp_details and Projects as 1:1. Enforce referential integrity
constraint on it and write down the steps for the same.
Ans. MS Access uses table relationships to join tables when you need to use them in a
database object. There are several reasons why you should create table relationships before
you create other database objects, such as forms, queries, macros, and reports.
 To work with records from more than one table, you often must create a query that
joins the tables.
 The query works by matching the values in the primary key field of the first table
with a foreign key field in the second table.
 When you design a form or report, MS Access uses the information it gathers from
the table relationships you have already defined to present you with informed
choices and to prepopulate property settings with appropriate default values.
 When you design a database, you divide your information into tables, each of which
has a primary key and then add foreign keys to related tables that reference those
primary keys.
 These foreign key-primary key pairings form the basis for table relationships and
multi-table queries.
For one to one relationship
The one to one relationship is used to relate one record from one table to one and only one
record in another table.
Steps to create a one to one relationship
 Create three tables and name them as Emp_details, Dept_details and Project.
 Close all the table and click on the Database tools in the ribbon bar.
 In the database tools click on the relationships option.
 Select Emp_details, Dept_details and Project and then click on the Add button to
add them to our view and then close the show table dialog box.

 To create a relationship between the two tables, use the mouse, and click and hold
the Product ID field from Product table and drag and drop that field on the
Employee ID by hovering the mouse right over Employee ID from Emp_details.
When you release your mouse button, Access will then open the following window –

 After that check box all the options in the dialog box and then click on the create
option.
The relationship is now saved automatically and there's no real need to click on the
Save button.
For one to many relationship
One to many relationships is where one record from a table has the potential to be
related to many records in another table.
Steps to create one to many relationship
 Go to the database tool in the ribbon bar and click on the relationship option. If it is
an existing table then drag the Employee ID from Emp_details table to
Dep_location in the Dept_details table.
 A dialog box will be opened. Click on all the check boxes and click on create.
 The relationship is now saved automatically and there's no real need to click on the
Save button.
Now click on the Product table and click on the plus sign on the left side. Fill up the
details.

After filling the details click on the Emp_details table and Dept_details all the
information will be saved in those tables automatically.
ASSIGNMENT 17(a)
QUES: Explain in brief about the query object in MS Access 2007. Write steps to
execute queries using the query wizard. Create an Account_details table with the
following fields:
 Acc_nor
 Acc_type
 Date_of_opening
 Transaction_type
 Balance
 AccountH_name
 Transaction_ID
Enter 12 records in the table and perform the following queries on it.
 Display the Acc_nor in ascending order
 Display the details of account where Acc_nor is 675
 Display the details where Acc_nor is 675 and name is Ajay
 Display the Acc_nor, Acc_type, AccountH_name, and balance is greater than
5000
Ans. In Access, queries are like questions that are asked to find related, even very specific,
information in a database. In queries, we sometimes use data from just one table and other
times from more than one. In Access, a query is a database object. It doesn’t store data.
Instead, it displays data that is stored in tables and it makes that data available for you to
work with. A query might show data from one or more tables, from other queries, or from a
combination of the two.
Steps to execute queries using query wizard
Create a blank database, create a table and name it as Account_details. Add all the fields
required and enter 12 records. After entering the records:
1. Select Create > Query Wizard.

2. Select Simple Query Wizard, and then select OK.


3. Select the table or query that contains the field, and then add the field to the Selected
Fields list. When you’re finished, select Next. Add as many fields as wanted.
4. Click on the Finish option. A new table will be created in the name of
Account_details Query.

5. Right click on the table Account_details Query and click on the Design view.

1. Display the Acc_nor in ascending order


i) Out of the other fields click on the Acc_nor.
ii) In the sort option click on the Ascending order option.
iii) Click on the Run option from the ribbon bar.
2. Display the details of the account where the Acc_nor is 675.
I. Select all the field in the query table.
II. In the Acc_nor box type =675.
III. Click on the Run option.
IV. The record with the account number with 675 will only be displayed.
3. Display the details where Acc_nor is 675 and name is Ajay
I. Select all the fields in the query box.
II. In the Acc_nor field box write =675 and in the AccountH_name write
=Ajay.
III. the record consisting of the account number as 675 and name as Ajay will be
displayed.

4. Display the Acc_nor, Acc_type, AccountH_name, and balance is greater than 5000
I. Click the Acc_nor, Acc_type, AccountH_name and Balance.
II. Under the Balance field enter >5000.
III. Click on the Run option.
IV. All those records will be displayed whose balance is greater than 5000.
ASSIGNMENT 17(b)
Ques. Create a table Student with the following fields:
 Enrolment_nor
 S_name
 Course_id
 Batch
 Semester
Execute the following queries after entering 10 records in the table.
 Display the list of students in batch 2017-2020
 Display the Enrolment_nor of fourth semester students
 Display the list of students of batch 2017-2020 and Course_id is 17.
 Display the number of students in Course_id 44.
Ans. Create a database and create a table named as Student. Enter the fields and records
required.

A. Display the list of students in batch 2017-2020


 Go to the sql view by right clicking on the query tab
 Write the code as given below

 Click on the Run option.


 The records of students who are in the 2017-2020 will be displayed.
Using query design
 In the query design, write the command SELECT S_name FROM Student
WHERE Batch=2017-20;
 The records will be displayed.

B. Display the Enrolment_nor of the fourth semester students


Using query design
 Wite the command SELECT Enrolment_id FROM Student WHERE Semester
=4;
 The records will be displayed.

C. Display the list of students whose batch is 2017-2020 and the Course_id is 17.
Using query design
 Write the command SELECT S_name FROM Student WHERE Batch=2017-20,
Course_id=17;
 The records will be displayed.
D. Display the number of students whose Course_id is 44.
Using query design
 In the query design, write the command SELECT COUNT(S_name) FROM
Student WHERE Course_id=44;
 The records will be displayed.
ASSIGNMENT 18(a)
Ques. Create the following table CUSTOMER having the columns, data types
Field name Data type
Customer_id Number
Customer_name Text
Designation Text
City Text
Country Text
Phone Number
Insert the data into the table Customer and apply the queries.
 Display customer details having designation Sales representative.
 Retrieve customers who is living in Canada.
 Show details of the customer whose name is Victoria.
 Show details of the customer who lives in Sweden.
 Show details of the customer who is owner.
Ans. Create a table in the new database of MS Access and name the table as Customer.

Using query design


 Go to the Create option in the ribbon bar.
 Click on the Query Design option.
 A dialog box will appear, add the Customer table and close the table.
 A new table in the name of Query will be formed. Right click on the table and click
on the SQL view.
 Write down the commands.
1. Display customer details whose designation is Sales representative
 In the query design write down the command SELECT* FROM Customer
WHERE Designation=’Sales representative’;
 The records will be displayed.
2. Retrieve the customers whose living in Canada
 Write the command SELECT* FROM Customer WHERE Country=’Canada’; in
the query design.
 The records will be displayed.

3. Show the details of the customer whose name is Victoria


 Write the command SELECT*FROM Customer WHERE
Customer_name=’Victoria’; in the query design.
 The results will be displayed.
1. Show the details of the customer who lives in Sweden
 In the query design, write down the command SELECT* FROM Customer
WHERE Country=’Sweden’;
 The records will be displayed.

2. Show the details of the customer who is the owner


 Write down the command SELECT* FROM Customer WHERE
Designation=’Owner’; on the query design.
 The records will be displayed.
ASSIGNMENT 18(b)
Ques. Create a table named as STUDENT with the following fields:
 Serial_nor
 Name
 City
 Age
 Marks
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 marks along with the names where the marks are greater than 60
 Display the name of the students whose name starts with the letter “A”
 Display the details of students who lives in “Delhi’’
 Display the details of students who are older than 10 years
Ans. Create a table and name it as Student. Enter the fields required and enter 10 records.
A. Display all the details of the given table
I. Click on the create and click on the query wizard.
II. Select Simple Query Wizard, and then select OK.
III. Select the table or query that contains the field, and then add the field to
the Selected Fields list. When you’re finished, select Next. Add as many
fields as wanted.
IV. Click on the Finish option, a new table will be created in the name of Student
Query.
V. In the Design view of the Student Query table tick on the all the field.
VI. Click on the Run option.
VII. All the details of the table will be displayed.

B. Display the names in alphabetical order


I. Select the Names field.
II. Click on the Ascending order option in the Sort option.
III. Click on the Run option
IV. All the names will be displayed in the alphabetical order.

C. Display the marks along with the names where the marks are greater than 60
I. Click on the Marks and Names fields in the Student Query table.
II. Under the Marks filed write >60.
III. Click on the Run option.
IV. All the records will be displayed whose marks are greater than 60.
D. Display the name of the students whose name starts with the letter ‘A’
I. Select the Name field in the Student Query table.
II. Under the Name field write LIKE ‘A*’.
III. Click on the Run option.
IV. All the names which starts with the latter ‘A’ will be displayed.

E. Display the details of student who lives in Delhi


I. Select all the fields in the Student Query table.
II. Under the City field write =Delhi.
III. Click on the Run option.
IV. All the records of students who lives in Delhi will be displayed.

F. Display all the details of the students who are older than years
I. Click on all the fields in the Student Query table.
II. Under the Age field write >10.
III. Click on the Run option.
IV. All the records of the students who are older than 10 years will be displayed.
ASSIGNMENT 18(c)
Ques. Create a table Employee with the following fields:
 Emp_id, Emp_name, Contact_nor, Gender, Salary, Emp_grade, Designation,
Address
Execute the following queries on the table created:
 Display the details of the employees
 Display the employee ID whose name is Supriya
 Display the name of the employee whose contact number is 9845486301
 Display the details of the employee whose address is D-29, IITM Janakpuri
 Display the name of the employee whose salary is >10000
 Update the employee details, set the emp_grade equal to C whose salary is less
than 10000
 Delete the record of the employees whose gender is male and designation is
manager
 Display the name, designation and salary of all the employees whose name starts
with A
 Update the employee details, set designation to assistant manager where
designation is trainee.
 Display the employee id, name, salary and designation for the employee where
grade is A
Ans. Create a table in the name of Employee in the blank database and enter the records
required.

1. Display the details of the employees


 In the query design write down the query SELECT* FROM Employee; and click on
the RUN option.
 The records will be displayed.
2. Display the employee id whose name is Supriya
 Write the query SELECT Emp_id FROM Employee WHERE
Emp_name=’Supriya’; and click on the run option.
 The employee id will be displayed

3. Display the name of the employee whose contact number is 9845486301


 In the query design, write down the query SELECT Emp_name FROM Employee
WHERE Contact_nor=9845486301; and click on the RUN option.
 The records will be displayed.

4. Display the details of the employee whose address is D-29, IITM Janakpuri
 Write the query SELECT* FROM Employee WHERE Address=’D-29, IITM
Janakpuri’; and click on the RUN option.
 The record will be displayed.
5. Display the name of the employee whose salary is >10000
 In the query design, write down the query SELECT Emp_name FROM Employee
WHERE Salary>10000; and click on the RUN option.
 The record will be displayed.

3. Update the employee details, set the emp_grade equal to C whose salary is less than
10000
 Write the query, UPDATE Employee SET Emp_grade=’C’ WHERE
Salary<10000; and click on the YES option and then on RUN.
 The records will be updated.

4. Delete the record of the employees whose gender is male and designation is manager
 Write the query, DELETE FROM Employee WHERE Gender=’Male’ and
Designation=’Manager’; and click on the YES option and then RUN the query.
 The records will be deleted.
5. Display the name, designation and salary of all the employees whose name starts with A
 Write the query, SELECT Emp_name, Designation, Salary FROM Employee
WHERE Emp_name=’LIKE*A’; and click on the RUN option.
 The records will be displayed.

6. Update the employee details, set designation to assistant manager where designation is
trainee.
 In the query design, write the query, UPDATE Employee SET
Designation=’Assistant Manager’ WHERE Designation=’Trainee’; and click
on the RUN option.
 The records will be updated.

7. Display the employee id, name, salary and designation for the employee where grade is
A
 In the query design, write down the query, SELECT Emp_id, Emp_name,
Salary, Designation FROM Employee WHERE Emp_grade=’A’; and click on
the RUN option.
 The records will be displayed.
ASSIGNMENT 19(a)
Ques: Create a table Employee with the following fields:
 Emp_ID
 Emp_name
 Dept_name
 Salary
 Address
 Date of joining
Perform the following queries:
 Delete the records of the table whose Emp_ID=101
 Delete the records of the employees whose Dept_name is HR and salary >10000
 Delete the records of the employees whose name begins with S or salary>10000
 Update the records of the employees, set Dept_name= IT where
Dept_name=Production
 Update the records of the employees, set salary=15000 whose Dept_name is IT.

. In the blank database create a table named Employee and enter the records.

1. Delete the records of the employees whose Emp_ID=101.


 In the query design, write down the command DELETE FROM Employee
WHERE Emp_id=’101’; and click YES in the dialog box and then on the RUN
option.
 The record whose Emp_id =101 will be deleted.
2. Delete the records of the employees whose Dept_name =HR and salary>10000.
 Wite the query DELETE FROM Employee WHERE Dept_name=’HR’ AND
Salary>10000; in the quey design and click YES in the dialog box and then on the
RUN option.
 The records will be deleted.

3. Delete the records of the employees whose name begins with S or salary>10000.
 In the query design write down the query DELETE FROM Employee WHERE
Emp_name=’LIKE*S’ OR Salary>10000; and click YES and then on the RUN
option.
 The records will be deleted.
4. Update the records of the employees, set the Dept_name as IT where the Dept_name is
Production
 Write down the query UPDATE Employee SET Dept_name=’IT’ WHERE
Dept_name=’Production’; and click on YES in the dialog box and then on the
RUN option.
 The records will be updated.

5. Update the records of the employees, set the salary =15000 whose Dept_name=IT.
 Write down the query UPDATE Employee SET Salary=15000 WHERE
Dept_name=’IT’; in the query design and click YES and then click on the RUN
option.
 The records will be updated.

ASSIGNMENT 19(c)
Ques: Create a table named as STUDENT_MARKS with the following fields as:
 S_nor
 Name
 Marks
Execute the following queries after entering 10 records in the table.
 Display the S_nor of those students whose names starts with L and ends with A
and marks less than 70.
 Display the name and S_nor of those students who have scored marks equal to
95.
 Display the names and marks of all those students who have scored between 75
and 90.
Ans. Create a database in which create a table named as Student_Marks. Enter 10 records as
required.

Using query wizard:


8. Display the S_nor of those students whose names starts with L and ends with A and
marks less than 70.
 Click on the S_nor fields in the query table.
 Enter LIKE’L*A’ in the in the Name field of the Student marks query table.
 Enter <70 in the Marks field.
 Click on to the Run option.
 The record of the students whose name starts with L and ends With A will be
displayed.

9. Display the name and S_nor of those students who have scored marks equal to 95
 Tick on the check box of S_nor and Name fields.
 Under the Marks field enter =95.
 Click on the Run option.
 All the names and s_nor of those students whose marks are equal to 95 will be
displayed.

10. Display the name and marks of all the students who have scored marks between 75 and
90
 Click on the Name and Marks fields from the query table.
 Under the Marks field enter BETWEEN 75 and 90.
 Click on the Run option.
 All the records of students who scored marks between 75 and 90 will be displayed.

ASSIGNMENT 20
Ques: Write SQL Queries using Data Manipulation Commands Insert record into
Table named Employee with Fields
 EMP_ID
 EMP_NAME
 EMP_DESIGNATION
 EMP_AGE
 EMP_DEPARTMENT
 EMP_SALARY
And make EMP_ID as the primary key.
4. Write a query to find the salary of a person where age is <= 26 and salary >=
25000 from Employee Table.
5. Write a query to find the name of Employee whose name is like “Ku%”.
Write a query to find the customer details using “IN” and “Between” operator where
age can be 25 or 27.
1. Create a database in which create a table named as employee. Enter 10 records as required.

find the salary of a person where age is <= 26 and salary >= 25000 from Employee
Table.

2. go to create> query wizard> finish


3. a query will be created. Now go to its sql view and type in the below command and hit run.

find the name of Employee whose name is like “Ku%”.

5. again create a query, go to its sql view, write the below command and hit run.
find the customer details using “IN” and “Between” operator where age can be 25 or
27.
ASSIGNMENT 21
Ques. Create a table employee with 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 employees working in the same dept.
3. Find employees id, emp_name of the employee having same DOB.
Ans. In a blank database create a table named Employee and enter the records required.
1. Find the employee ids of the employees having same salary.
 Write the query SELECT DISTINCT E1.Emp_id FROM Employee E1,
Employee E2 WHERE E1. Salary=E2.Salary AND E1.Emp_id<>E2.Emp_id;
and click on the RUN option.
 The records will be displayed.

2. Find the details of the employees working in the same dept.


 Write the query SELECT DISTINCT E1.Emp_id,E1.Emp_name, E1.Dept_name,
E1.Salary, E1.Address, E1.DOB FROM Employee E1, Employee E2 WHERE
E1.Dept_name=E2.Dept_name AND E1.Emp_id<>E2.Emp_id; and click on the
RUN option.
 The records will be displayed.

3. Find employees id, emp_name of the employee having same DOB


 write the query SELECT DISTINCT E1.Emp_id, E1.Emp_name FROM
Employee E1, Employee E2 WHERE E1.DOB=E2.DOB AND
E1.Emp_id<>E2.Emp_id; and then click on the RUN option.
 The records will be displayed.
ASSIGNMENT 22
Ques: Discuss All DDL Commands with its syntax.
Data Definition Language(DDL) is a subset of SQL and a part of DBMS(Database
Management System). DDL consist of Commands to commands like CREATE,
ALTER, TRUNCATE and DROP. These commands are used to create or modify
the tables in SQL.

Command-1 :
CREATE :
This command is used to create a new table in SQL. The user has to give information like
table name, column names, and their datatypes.
Syntax –
CREATE TABLE table_name

column_1 datatype,

column_2 datatype,

column_3 datatype,

....

);

Example –
We need to create a table for storing Student information of a particular College. Create
syntax would be as below.
CREATE TABLE Student_info

College_Id number(2),

College_name varchar(30),

Branch varchar(10)

);
Command-2 :
ALTER :
This command is used to add, delete or change columns in the existing table. The user
needs to know the existing table name and can do add, delete or modify tasks easily.
Syntax –
Syntax to add a column to an existing table.
ALTER TABLE table_name

ADD column_name datatype;

Example –
In our Student_info table, we want to add a new column for CGPA. The syntax would be as
below as follows.
ALTER TABLE Student_info

ADD CGPA number;

Command-3 :
TRUNCATE :
This command is used to remove all rows from the table, but the structure of the table still
exists.
Syntax –
Syntax to remove an existing table.
TRUNCATE TABLE table_name;

Example –
The College Authority wants to remove the details of all students for new batches but wants
to keep the table structure. The command they can use is as follows.
TRUNCATE TABLE Student_info;

Command-4 :
DROP :
This command is used to remove an existing table along with its structure from the
Database.
Syntax –
Syntax to drop an existing table.
DROP TABLE table_name;
Example –
If the College Authority wants to change their Database by deleting the Student_info
Table.
DROP TABLE Student_info;
ASSIGNMENT 23
Ques: Write SQL Queries using Data Definition Commands like CREATE, DROP,
TRUNCATE, RENAME, ALTER.
Create Table named Student with Fields Student id, Name, Age, Course, Fees.
And apply above mentioned commands on the table.

1. Create table using create command in the sql view as below


2. Then hit RUN!

3. Now insert values using insert command and hit run

1. Now write the alter command in the query and hit run
3. Delete
Rename

Drop
ASSIGNMENT 24

Ques: Discuss All DML Commands with its syntax

Data Manipulation Language (DML) commands in SQL deals with manipulation of data
records stored within the database tables. It does not deal with changes to database objects
and its structure. The commonly known DML commands are INSERT, UPDATE and
DELETE. Liberally speaking, we can consider even SELECT statement as a part of DML
commands. Albeit, it strictly forms part of the Data Query Language (DQL) command.

we will be learning about all the above mentioned DML commands in great detail in the
subsequent sections. But let us first have a look at this summary table for a brief overview on
each of them.

Command Description

SELECT Used to query or fetch selected fields or columns from a database table

INSERT Used to insert new data records or rows in the database table

UPDATE Used to set the value of a field or column for a particular record to a new
value

DELETE Used to remove one or more rows from the database table

Commands of DML

Now let us try to understand each of the above mentioned DML commands in detail one by
one.

1. SELECT

SELECT command or statement in SQL is used to fetch data records from the database table
and present it in the form of a result set. It is usually considered as a DQL command but it
can also be considered as DML.
The basic syntax for writing a SELECT query in SQL is as follows :

SELECT column_name1, column_name2, …

FROM table_name

WHERE condition_ expression;

The parameters used in the above syntax are as follows :

 column_name1, column_name2, … : Specify the column_names which have to be


fetched or selected for the final result set.
 table_name: Specify the name of the database table from which these results have to
be fetched.
 condition_expression: Specify the condition expression for filtering records for the
final result set.
Here are a few examples to illustrate the use of SELECT command.

SELECT customer_id,

sale_date,

order_id,

store_state

FROM customers;

The query returns the following output.


In this example, we have fetched fields such as customer_id, sale_date, order_id and
store_state from customers table. Next, suppose if we want to fetch all the records from the
customers table. This can be achieved by a simple query as shown below.

SELECT * FROM customers;

The query returns the following output.


2. INSERT

INSERT commands in SQL are used to insert data records or rows in a database table. In an
INSERT statement, we specify both the column_names for which the entry has to be made
along with the data value that has to be inserted.

The basic syntax for writing INSERT statements in SQL is as follows :

INSERT INTO table_name (column_name_1, column_name_2, column_name_3, ...)

VALUES (value1, value2, value3, ...)

By VALUES, we mean the value of the corresponding columns.

Here are a few examples to further illustrate the INSERT statement.

INSERT INTO public.customers(

customer_id, sale_date, sale_amount, salesperson, store_state, order_id)

VALUES (1005,'2019-12-12',4200,'R K Rakesh','MH','1007');

Here we have tried to insert a new row in the Customers table using the INSERT command.
The query accepts two sets of arguments, namely field names or column names and their
corresponding values.

Suppose if we have to insert values into all the fields of the database table, then we need not
specify the column names, unlike the previous query. Follow the following query for further
illustration.

INSERT INTO customers

VALUES ('1006','2020-03-04',3200,'DL', '1008');


In this example, we have successfully inserted all the values without having to specify the
fieldnames.

3. UPDATE

UPDATE command or statement is used to modify the value of an existing column in a


database table.

The syntax for writing an UPDATE statement is as follows :

UPDATE table_name

SET column_name_1 = value1, column_name_2 = value2, ...

WHERE condition;

Having learnt the syntax, let us now try an example based on the UPDATE statement in SQL.

UPDATE customers

SET store_state = 'DL'

WHERE store_state = 'NY';

In this example, we have modified the value of store_state for a record where store_state was
‘NY’ and set it to a new value ‘DL’.

4. DELETE

DELETE statement in SQL is used to remove one or more rows from the database table. It
does not delete the data records permanently. We can always perform a rollback operation to
undo a DELETE command. With DELETE statements we can use the WHERE clause for
filtering specific rows.

The syntax for writing an DELETE statement is as follows :

DELETE FROM table_name WHERE condition;


Having learnt the syntax, we are all set to try an example based on the DELETE command in
SQL.

DELETE FROM customers

WHERE store_state = 'MH'

AND customer_id = '1001';

In this example, we have removed a row from the customer’s table where store_state was
‘MH’ and customer_id was ‘1001’.

ASSIGNMENT 25
Ques: Define all aggregate functions with its work defined in sql.

Aggregate functions in DBMS take multiple rows from the table and return a value according
to the query.

All the aggregate functions are used in Select statement.

Syntax −

SELECT <FUNCTION NAME> (<PARAMETER>) FROM <TABLE NAME>

AVG Function

This function returns the average value of the numeric column that is supplied as a parameter.

Example: Write a query to select average salary from employee table.

Select AVG(salary) from Employee

COUNT Function

The count function returns the number of rows in the result. It does not count the null values.

Example: Write a query to return number of rows where salary > 20000.

Select COUNT(*) from Employee where Salary > 20000;

Types −

 COUNT(*): Counts all the number of rows of the table including null.
 COUNT( COLUMN_NAME): count number of non-null values in column.
 COUNT( DISTINCT COLUMN_NAME): count number of distinct values in a
column.

MAX Function

The MAX function is used to find maximum value in the column that is supplied as a
parameter. It can be used on any type of data.

Example − Write a query to find the maximum salary in employee table.

Select MAX(salary) from Employee


SUM Function

This function sums up the values in the column supplied as a parameter.

Example: Write a query to get the total salary of employees.

Select SUM(salary) from Employee

STDDEV Function

The STDDEV function is used to find standard deviation of the column specified as
argument.

Example − Write a query to find standard deviation of salary in Employee table.

Select STDDEV(salary) from Employee

VARIANCE Function

The VARIANCE Function is used to find variance of the column specified as argument.

Example −

Select VARIANCE(salary) from Employee


ASSIGNMENT 26

Ques: Describe the context of forms in MS access

A form in Access is a database object that you can use to create a user interface for a database
application. A "bound" form is one that is directly connected to a data source such as a table
or query, and can be used to enter, edit, or display data from that data source. Alternatively,
you can create an "unbound" form that does not link directly to a data source, but which still
contains command buttons, labels, or other controls that you need to operate your application.
This article focuses primarily on bound forms. You can use bound forms to control access to
data, such as which fields or rows of data are displayed. For example, certain users might
need to see only several fields in a table with many fields. Providing those users with a form
that contains only those fields makes it easier for them to use the database. You can also add
command buttons and other features to a form to automate frequently performed actions.
Think of bound forms as windows through which people see and reach your database. An
effective form speeds the use of your database, because people don't have to search for what
they need. A visually attractive form makes working with the database more pleasant and
more efficient, and it can also help prevent incorrect data from being entered.

Use the Form tool to create a new form

1. In the Navigation Pane, click the table or query that contains the data you want to see on your
form.
2. On the Create tab, in the Forms group, click Form.
Access creates the form and displays it in Layout view. In Layout view, you can make design
changes to the form while it is displaying data. For example, you can adjust the size of the
text boxes to fit the data, if necessary.
If Access finds a single table that has a one-to-many relationship with the table or query that
you used to create the form, Access adds a datasheet to the form that is based on the related
table or query. For example, if you create a simple form that is based on the Employees table,
and there is a one-to-many relationship that is defined between the Employees table and
Orders table, the datasheet displays all the records in the Orders table that relate to the current
Employee record. You can delete the datasheet from the form if you decide you do not need
it. If there is more than one table with a one-to-many relationship to the table that you used to
create the form, Access does not add any datasheets to the form.

Create a split form by using the Split Form tool

A split form gives you two views of the data at the same time — a Form view and a
Datasheet view.
A split form differs from a form/subform combination in that the two views are connected to
the same data source and are synchronized with one another at all times. Selecting a field in
one part of the form selects the same field in the other part of the form. You can add, edit, or
delete data from either part (as long as the record source is updatable, and you have not
configured the form to prevent these actions).
Working with split forms gives you the benefits of both kinds of forms in a single form. For
example, you can use the datasheet portion of the form to quickly locate a record, and then
use the form portion to view or edit the record.
To create a split form by using the Split Form tool:
1. In the Navigation Pane, click the table or query that contains the data that you want on your
form. Or open the table or query in Datasheet view.
2. On the Create tab, in the Forms group, click More Forms, and then click Split Form.
Access creates the form and displays it in Layout view. In Layout view, you can make design
changes to the form while it is displaying data. For example, you can adjust the size of the
text boxes to fit the data, if necessary. For more information about form views, see
the Understand Layout view and Design view section.

Create a form that displays multiple records by using the Multiple Items tool

When you create a form by using the Form tool, the form that Access creates displays a
single record at a time. If you want a form that displays multiple records but is more
customizable than a datasheet, you can use the Multiple Items tool.
1. In the Navigation Pane, click the table or query that contains the data you want to see on your
form.
2. On the Create tab, in the Forms group, click More Forms, and then click Multiple Items.
Access creates the form and displays it in Layout view. In Layout view, you can make design
changes to the form while it is displaying data.
When you use the Multiple Items tool, the form that Access creates resembles a datasheet.
The data is arranged in rows and columns, and you see more than one record at a time.
However, a Multiple Items form gives you more customization options than a datasheet, such
as the ability to add graphical elements, buttons, and other controls. For more information
about customizing your form, see the sections Fine-tune your form in Layout view and Fine-
tune your form in Design view.

Create a form by using the Form Wizard

To be more selective about what fields appear on your form, you can use the Form Wizard
instead of the various form-building tools previously mentioned. You can also define how the
data is grouped and sorted, and you can use fields from more than one table or query, as long
as you specified the relationships between the tables and queries beforehand.
1. On the Create tab, in the Forms group, click Form Wizard.
2. Follow the directions on the pages of the Form Wizard.
Note: If you want to include fields from multiple tables and queries on your form, do not
click Next or Finish after you select the fields from the first table or query on the first page
of the Form Wizard. Instead, repeat the steps to select a table or query, and click any
additional fields that you want to include on the form. Then click Next or Finish to continue.
3. On the last page of the wizard, click Finish.

Create a form by using the Blank Form tool

If the wizard or the form-building tools don't meet your needs, you can use the Blank Form
tool to build a form. This can be a very quick way to build a form, especially if you plan to
put only a few fields on your form.
1. On the Create tab, in the Forms group, click Blank Form.
Access opens a blank form in Layout view, and displays the Field List pane.
2. In the Field List pane, click the plus sign (+) next to the table or tables that contain the fields
that you want to see on the form.
3. To add a field to the form, double-click it or drag it onto the form.
 After the first field has been added, you can add several fields at once by holding down the
CTRL key, clicking several fields, and then dragging them onto the form at the same time.
 The order of the tables in the Field List pane can change, depending on which part of the
form is currently selected. If the field you want to add is not visible, try selecting a different
part of the form and then try adding the field again.
4. Use the tools in the Header/Footer group on the Design tab to add a logo, title, or the date
and time to the form.
5. Use the tools in the Controls group of the Design tab to add a wider variety of controls to the
form.
For a slightly larger selection of controls, switch to Design view by right-clicking the form
and then clicking Design View.

Understand Layout view and Design view

Layout view Layout view is the most intuitive view to use for form modification, and it can
be used for almost all the changes that you would want to make to a form in Access.
In Layout view, the form is actually running. Therefore, you can see your data much as it will
appear when you are using the form. However, you can also change the form design in this
view. Because you can see the data while you are modifying the form, this is a very useful
view for setting the size of controls or performing almost any other task that affects the
appearance and usability of the form.
If you encounter a task that cannot be performed in Layout view, you can switch to Design
view. In certain situations, Access displays a message that states that you must switch to
Design view before you can make a particular change.
Design view Design view gives you a more detailed view of the structure of your form.
You can see the Header, Detail, and Footer sections for the form. The form is not actually
running when it is shown in Design view. Therefore, you cannot see the underlying data
while you are making design changes. However, there are certain tasks that you can perform
more easily in Design view than in Layout view. You can:
 Add a wider variety of controls to your form, such as bound object frames, page breaks, and
charts.
 Edit text box control sources in the text boxes themselves, without using the property sheet.
 Resize form sections, such as the Form Header or the Detail section.
 Change certain form properties that cannot be changed in Layout view.

Fine-tune your form in Layout view

After you create a form, you can easily fine-tune its design by working in Layout view. Using
the actual form data as your guide, you can rearrange the controls and adjust their sizes. You
can place new controls on the form and set the properties for the form and its controls.
To switch to Layout view, right-click the form name in the Navigation Pane and then
click Layout View.
Access shows the form in Layout view.
You can use the property sheet to change the properties for the form and its controls and
sections. To display the property sheet, press F4.
You can use the Field List pane to add fields from the underlying table or query to your form
design. To display the Field List pane:
 On the Design tab, in the Tools group, click Add Existing Fields or use the keyboard
shortcut by pressing ALT+F8.
You can then drag fields directly from the Field List pane onto your form.
 To add a single field, double-click it or drag it from the Field List pane to the section on the
form where you want it displayed.
 To add several fields at once, hold down CTRL and click the fields that you want to add.
Then drag the selected fields onto the form.

Fine-tune your form in Design view

You can also fine-tune your form's design by working in Design view. You can add new
controls and fields to the form by adding them to the design grid. The property sheet gives
you access to many properties that you can set to customize your form.
To switch to Design view, right-click the form name in the Navigation Pane and then
click Design View.
Access shows the form in Design view.
You can use the property sheet to change the properties for the form and its controls and
sections. To display the property sheet, press F4.
You can use the Field List pane to add fields from the underlying table or query to your form
design. To display the Field List pane:
 On the Design tab, in the Tools group, click Add Existing Fields or use the keyboard
shortcut by pressing ALT+F8..
You can then drag fields directly from the Field List pane onto your form.
 To add a single field, double-click it or drag it from the Field List pane to the section on the
form where you want it displayed.
 To add several fields at once, hold down CTRL and click the fields that you want to add.
Then drag the selected fields onto the form.
ASSIGNMENT 27
Ques. Create two tables Employee ands Department with the following fields:
1. Employee
 F_name
 L_name
 E_id
 DOB
 Address
 Salary
2. Department
 D_no
 D_name
 MGR_NO
 MGR_doj
Create the forms for the employees as well as the department in tabular form and write
the steps in create forms. Also provide the suitable title to both the forms and insert the
page no’s to it.
Ans. A form in Access is a database object that you can use to create a user interface for a
database application. A "bound" form is one that is directly connected to a data source such
as a table or query, and can be used to enter, edit, or display data from that data source.
Create the tables Employee and Department.
Employee table

Department table
Creating form through Form wizard
In the database open the CREATE tab. In the forms group in the upper right-hand corner
there will be FORM WIZARD button.

Click on that button to launch the Form Wizard.


On this first screen in the wizard, select fields that is wanted to display on the form, and can
choose from fields from more than one table or a query.
From Tables/Queries drop-down list, select Employee table. Click on the double arrow to
move all the fields at once.

Click the next option.


Click on the layout which ever is required and click on the next option.

The title of the form changed to Employee_form_wizard. After changing the title click on
the finish option.

The form is created using the Form wizard. Using the navigation button below, the records
can be changed from one to other.

New records can also be added in the form directly which will automatically be recorded in
the table.
Design view of Employee_form_wizard

The forms using the form wizard can be created similarly for the Department table also.
Design view of the Department_form_wizard

Creating using the form option


In the create tab, click on the FORM option.
The form is created using the form option in the create tab. The record can the moved from
one to other using the navigation buttons below.

The title of the can also be changed.


Using the form view, new records can also be added to the form.

The record that is entered directly in the forms will be automatically recorded in the tables.
Design view of the employee_form
The forms using the form can be created similarly for the Department table also.

Design view of the Department_form

Creating forms using multiple items


Open the create tab, in the forms there is the option of MORE FORMS. Click on the multiple
items.
Using the navigation buttons the records can be moved from one to another. And new
records can be added using the form view, which will automatically be recorded in the table.
The title of the form can also be changed.
Design view of the Employee_multiple_items

The forms using the multiple items can be created similarly for the Department table also.

Design view of Department_multiple_items


Creating forms using Split form
Open the create tab, in the forms there is the option of MORE FORMS. Click on split form.

Using the navigation buttons the we can move from one record to another. New record can
be added either directly on the form or on the table. But it automatically will the entered on
the either of the one. The title of the form can also be changed.
Design view of Employee_splitform

Similarly, the form can be created using the split form for the Department table.

Design view of the Department_splitform


ASSIGNMENT 28

Ques: Create a table named STUDENT_DETAILS with the following fields:


 R_no
 Name
 Course name
 Attendance
 Dob
 Address
Course will have values either ISM or FMI. Enter 5 records. Create a form for the
above table in design view. Add text box and the following buttons to it:
 Go to first record
 Go to last record
 Go to previous record
 Go to next record Add a label student form to it.
1. Create the table as required

2. now go to create> form design

3. a blank form will appear. Now add the existing records from the table by clicking on the
add existing records button.

4. right click and go to the layout. It will look like this.


Add a label student form to it
5. select the label option from the design view and write student form

Add the following buttons


ASSIGNMENT 29

Ques: Create a table named as BBA_M1 with the following fields:


 E_no
 Student name
 Address
 Phone no
 Grade
Now create another table named as BBA_M2 with the same fields. Add at least 10
records to the table BBA_M1 (with first 10 enrollment no’s and BBA_M2 with next
10 e_no) and then perform the following queries on it.
 Create a make table query which contains the A grade students from
BBA_M1
 Append the A grade holders from BBA_M2 to the newly created table in the
above query.
a make table query which contains the A grade students from BBA_M1
Go to make table. The dialog box appears.

Click ok and hit run.

Append the A grade holders from BBA_M2 to the newly created table
Go to append table. The dialog box appears. Add the table name and the hit ok and run.
ASSIGNMENT 30
Ques: Write SQL Queries using SQL Commands Create a Table Product with
Fields
 PRO_ID
 PRO_NAME
 PRO_PRICE
And make PRO_ID as the primary key. Insert 10 Records into the Table.

4. Write a query to find the Name of Product where PRO_PRICE>= 500 from
PRODUCT Table.
5. Write a query to implement Aggregate Functions on field PRICE”.
Write a query to COUNT the number of Records in the Product Table.

1. make the table as below

find the Name of Product where PRO_PRICE>= 500 from PRODUCT Table.

implement Aggregate Functions on field PRICE

COUNT the number of Records in the Product Table


ASSIGNMENT 31
Ques: Create an ER diagram for college management system.

Identify Entity and Members


In a University , there are several departments and each department has a head of
department who belongs to Faculty. Department have a name , phone extension , specific
mailing address and Students that belong to the department. Students can belong to only
one Department at a time and Department can have more than one or no Student
Students and faculty have names and unique identification numbers , with address , age ,
gender and other information. Student studies different Courses offered by University .
Faculty teaches these Courses . In each semester one student can take more than one course
and Faculty can teach more than one courses . Faculty members can teach in
multiple Departments. Each course can be taught by many faculty members or no one
Faculty members are also working on multiple research projects. These projects are funded
by government and university. One project can have more than one faculty member and one
faculty member can work on more than one project

Decide Relationships , Cardinality and Modality


In a University , there are several departments and each department has a head of
department who belongs to Faculty. Department have a name , phone extension , specific
mailing address and Students that belong to the department. Students can belong to only
one Department at a time and Department can have more than one or no Student
Students and faculty have names and unique identification numbers , with address , age ,
gender and other information. Student studies different Courses offered by University .
Faculty teaches these Courses . In each semester one student can take more than one course
and Faculty can teach more than one courses . Faculty members can teach in
multiple Departments. Each course can be taught by many faculty members or no one
Faculty members are also working on multiple research projects. These projects are funded
by government and university. One project can have more than one faculty member and one
faculty member can work on more than one project

Draw Entities & Attribute Separately :


You may wonder about the members , as they can sometimes are missing , so we add the
missing attributes that are not in the requirement by the knowledge of the industry we are
designing the DBMS for . A primary key is a must attribute for every entity .
Student have Name , age , gender , address , phone Number , Roll Number , Semester ,
Course_ID and Student_ID. Faculty have Name , age , gender , address , phone Number ,
Semester , Course_ID, Grade , Salary , Faculty_ID and designation. Course have Name ,
Code , Student_ID , Faculty_ID , Department_ID and Course_ID. Department have Name ,
Student_ID , Faculty_ID and Department_ID. Research Project – Project_ID, Faculty_ID ,
Name , Duration.

See Below the diagram


Complete ERD

Create Relationships Between Entities.


We know the relationships from above steps and also what will be the cardinality and
modality. Using Crow’s Foot Notation . We have combined them .
If we have to read this diagram , this is how it will go . Reading symbols at the other end
Student-Department ; One Student Belongs to One and Only one Department
Department-Student : Department can have more than one student and no Student.
( *Business Logic ) .
Student-Course : Student must have one course and can have more than one.
Course-Student : One course can be offered to many students or no students at all
Course-Faculty : One course can be taught by many faculty member or no one (* Business
Logic )
Faculty-Course : One faculty member will teach one course or more than one courses
Can you do the same for Research Project and Faculty? Comment below . If you can.
*Business Logic : While you design an ERD . Never ever do anything with common sense
and stick strictly with the logic , common sense says if department doesn’t have a student,
how can it exist? But the user requirement says it can, Hence it will. Always stick with the
user requirements

ASSIGNMENT 32
Ques: Create an ER diagram for airline reservation system.
ASSIGNMENT 33
Ques: Create an ER diagram for employee management system.
Entities and their Attributes are
 Employee Entity : Attributes of Employee Entity are Name, Id, Address, Gender, Dob
and Doj.
Id is Primary Key for Employee Entity.
 Department Entity : Attributes of Department Entity are D_no, Name and Location.
D_no is Primary Key for Department Entity.
 Project Entity : Attributes of Project Entity are P_No, Name and Location.
P_No is Primary Key for Project Entity.
 Dependent Entity : Attributes of Dependent Entity are D_no, Gender and relationship.

ASSIGNMENT 34
Ques: Create an ER diagram for library management system.
Entities and their Attributes –
 Book Entity : It has authno, isbn number, title, edition, category, price. ISBN is the
Primary Key for Book Entity.
 Reader Entity : It has UserId, Email, address, phone no, name. Name is composite
attribute of firstname and lastname. Phone no is multi valued attribute. UserId is the
Primary Key for Readers entity.
 Publisher Entity : It has PublisherId, Year of publication, name. PublisherID is the
Primary Key.
 Authentication System Entity : It has LoginId and password with LoginID as Primary
Key.
 Reports Entity : It has UserId, Reg_no, Book_no, Issue/Return date. Reg_no is the
Primary Key of reports entity.
 Staff Entity : It has name and staff_id with staff_id as Primary Key.
 Reserve/Return Relationship Set : It has three attributes: Reserve date, Due date,
Return date.

You might also like