Sunteți pe pagina 1din 249

Ideal Institute of Management And Technology

DBMS LAB FILE


ON

Submitted To: Mr. Anil Sharma (Asst. Professor) Submitted By: Karan Malhotra 02621001709 BBA-Gen (Eve)

02621001709

Page 2

An undertaking such as this is never the work of a single person and this study is no exception. I, at the very outset, thank and express my gratitude to all those who directly or indirectly helped me a lot in completion of the present practical work and encouraged, inspired and enthusiasts me in the moments of despair and made it possible for this report to be in your hand today. First of all, I wish to express my profound feeling of gratitude and indebtedness to my Project Guide Mr. Anil Sharma, Asst. Professor, IIMT (Delhi) for his advice and guidance
02621001709 Page 3

during various stages of this practical. In spite of his pre-occupations and job responsibilities he has spared his time during the completion of this work. I thank him wholeheartedly. I wish to record my sincere gratitude to Dr. Sunil Kr. Niranjan, HOD (BBA), who provides constant support to me during my work.

02621001709

Page 4

02621001709

Page 5

02621001709

Page 6

02621001709

Page 7

This is to certify that Mr. Karan Malhotra pursuing BBA GEN from IDEAL INSTITUTE OF MANAGEMENT AND TECHNOLOGY has completed his DBMS Practical file under my supervision and guidance. He has taken care of all necessary aspects and shown interest and sincerity during the completion of computer fundamental file to my full satisfaction.

02621001709

Page 8

I certify that the file is up to my expectations as per the guidelines laid by the Guru Gobind Singh Indraprastha University.

02621001709

Page 9

ANIL SHARMA ( Asst. Professor, IIMT)

02621001709

Page 10

02621001709

Page 11

02621001709

Page 12

. 1. introduction 5
02621001709 Page 13

2 Database creation 7 3. Table creation 9

02621001709

Page 14

4. Table preview 15 5. Entering records into table 16

02621001709

Page 15

6. Queries 18 6.1 selection 18

02621001709

Page 16

6.2 addition of coloumn 22 6.3 inserting values in coloumn 23

02621001709

Page 17

6.4 greater then condition 24 6.5 delete 26

02621001709

Page 18

6.6insert 28 6.7orderby 30

02621001709

Page 19

6.8 update 34 7. Formes 38

02621001709

Page 20

8. Reports 42

02621001709

Page 21

02621001709

Page 22

Microsoft Access is a computer application used to create and manage computer-based databases on desktop computers and/or on connected computers (a network). Microsoft Access can be used for personal information management (PIM), in a small business to organize and manage data, or in an enterprise to communicate with servers.
02621001709 Page 23

Like any other computer application, in order to use Microsoft Access, you must first install it. After installing Microsoft Access, then you can open it. There are various ways you can open Microsoft Access. It gets launched like the usual products you have probably been using. As such, to start this program, you could click Start -> (All) Programs -> Microsoft Office -> Microsoft Office Access 2007. You can also launch it from Windows Explorer or My Computer. To do this, locate its shortcut in Windows
02621001709 Page 24

Explorer or My Computer. By default, Microsoft Access 2007 is located in C:\Program Files\Microsoft Office\Office12 and its shortcut is called MSACCESS.EXE. Once you have located it, you can then double-click it.

02621001709

Page 25

02621001709

Page 26

1.Features Of Ms-Access

02621001709

Page 27

Users can create tables, queries, forms and reports, and connect them together with macros. Advanced users can use VBA to write rich solutions with advanced data manipulation and user control. The original concept of Access was for end users to be able to access data from any source. Other uses include: the import and export of data to many formats including Excel, Outlook, ASCII, dBase,Paradox, FoxPro, SQL Server, Oracle, ODBC, etc. It also has the ability to link to data in its existing location and use it for viewing, querying, editing, and reporting. This allows the existing data
02621001709 Page 28

to change and the Access platform to always use the latest data. It can perform heterogeneous joins between data sets stored across different platforms. Access is often used by people downloading data from enterprise level databases for manipulation, analysis, and reporting locally. There is also the Jet Database format (MDB or ACCDB in Access 2007) which can contain the application and data in one file. This makes it very convenient to distribute the entire application to another user, who can run it in disconnected environments.
02621001709 Page 29

One of the benefits of Access from a programmer's perspective is its relative compatibility with SQL (structured query language) queries can be viewed graphically or edited as SQL statements, and SQL statements can be used directly in Macros and VBA Modules to manipulate Access tables. Users can mix and use both VBA and "Macros" for programming forms and logic and offers objectoriented possibilities. VBA can also be included in queries. Microsoft Access offers parameterized queries. These queries and Access tables can be referenced from other programs like VB6 and .NET through DAO or ADO.
02621001709 Page 30

From Microsoft Access, VBA can reference parameterized stored procedures via ADO.

02621001709

Page 31

1. History of Ms-access
Date 02621001709 Version Version Supported OS Page 32 Office suite version

number 1992 1993 Access 1.1 Access 2.0 1 2.0 Windows 3.0 Windows 3.1x Office 4.3 Pro

02621001709

Page 33

1995

Access for Windows 95

7.0

Windows 95 Windows 9x, NT 3.51/4.0

Office 95 Professional

1997

Access 97

8.0

Office 97 Professional and Developer

1999 02621001709

Access 2000

9.0 Windows 9x, NT 4.0, Page 34

Office 2000 Professional, Premium and

2000 Windows 98, Me, 2000, XP Windows 2000, Page 35

Developer

2001

Access 2002

10

Office XP Professional and Developer

2003 02621001709

Access 2003

11

Office 2003 Professional and Professional

XP,Vista Microsoft Office Access 2007 Windows XP SP2, Vista

Enterprise Office 2007 Professional, Professional Plus, Ultimate and Enterprise

2007

12

02621001709

Page 36

24-Apr- Microsoft Office Access 2009 2007 SP2

12

Windows XP SP2, Vista

Office 2007 Service Pack 2

02621001709

Page 37

02621001709

Page 38

1.

Click File->new.

02621001709

Page 39

2.

Select blank database.

02621001709

Page 40

02621001709

Page 41

3.

Type the name of database & press create.

02621001709

Page 42

02621001709

Page 43

02621001709

Page 44

4.

Database is created.

02621001709

Page 45

02621001709

Page 46

02621001709

Page 47

In Access tables can be created either by

1. DESIGN VIEW
02621001709 Page 48

1. Click on the create table using Design View.

02621001709

Page 49

02621001709

Page 50

02621001709

Page 51

02621001709

Page 52

2.Enter the required field name and there data types.

02621001709

Page 53

02621001709

Page 54

3. Assign primary key to a field by right clicking on the field and selecting primary key or selecting primary key from

02621001709

Page 55

edit menu.

02621001709

Page 56

02621001709

Page 57

5.

Select file->save to save the design of table.

02621001709

Page 58

02621001709

Page 59

6. Enter the mane for the table and press Ok.

02621001709

Page 60

7.

Table will be created.

02621001709

Page 61

02621001709

Page 62

02621001709

Page 63

2. Creating table using SQL command. 1. Select Queries from objects.

02621001709

Page 64

02621001709

Page 65

2. Select create query in design view.

02621001709

Page 66

02621001709

Page 67

02621001709

Page 68

3. Close this window & select view->SQL view.

02621001709

Page 69

02621001709

Page 70

4. Enter the create query.

02621001709

Page 71

02621001709

Page 72

5. Press run button.!

02621001709

Page 73

02621001709

Page 74

02621001709

Page 75

Table created using design view.

02621001709

Page 76

02621001709

Page 77

Table created using SQL query.

02621001709

Page 78

02621001709

Page 79

02621001709

Page 80

1. Select the table in which you want to enter the records.

02621001709

Page 81

02621001709

Page 82

02621001709

Page 83

2.

Enter the desired records.

02621001709

Page 84

02621001709

Page 85

3.

Save the table

02621001709

Page 86

02621001709

Page 87

02621001709

Page 88

02621001709

Page 89

1. To show all records where city is Delhi.


a) 1.
02621001709

using design view

Select create query in design view.


Page 90

02621001709

Page 91

02621001709

Page 92

02621001709

Page 93

2. Select the tables, Click add & then close above window.

02621001709

Page 94

02621001709

Page 95

3.Drag and drop the fields required in query.

02621001709

Page 96

02621001709

Page 97

4. Press run button. !

02621001709

Page 98

02621001709

Page 99

5. Save the query by file->save

02621001709

Page 100

6. Press ok.

02621001709

Page 101

02621001709

Page 102

b.(using SQL command) 1. Enter the SQL query & press run.

02621001709

Page 103

02621001709

Page 104

Output

02621001709

Page 105

02621001709

Page 106

02621001709

Page 107

2. Adding new coloumn


1. Select create query using design view-> SQL.

02621001709

Page 108

2.

Enter the Alter SQL query.

02621001709

Page 109

02621001709

Page 110

3.

Run !. output

4.

02621001709

Page 111

02621001709

Page 112

3.

Insert the values in table


Page 113

02621001709

Click on the table in which you want to insert values and enter the values.

02621001709

Page 114

02621001709

Page 115

02621001709

Page 116

02621001709

Page 117

02621001709

Page 118

4.

a. (using design view) 1. select create query in design view. Select the tables needed for the query

To show students above 75 marks.

02621001709

Page 119

02621001709

Page 120

2.drag and drop all the required fields and enter the

02621001709

Page 121

02621001709

Page 122

condition.

3. Press the run button.!

02621001709

Page 123

02621001709

Page 124

4. Save the query. File->save->enter name->ok. b. (using SQL query)

02621001709

Page 125

1.

Select create query in design view->SQL

02621001709

Page 126

02621001709

Page 127

2.

Press the run button.!

02621001709

Page 128

02621001709

Page 129

5. To delete the record of the student


a. (using design view)

02621001709

Page 130

1.

Select create query in design view.

02621001709

Page 131

02621001709

Page 132

2.

Select the tables needed for the query

02621001709

Page 133

3.

Select query->Delete query.

02621001709

Page 134

02621001709

Page 135

4.

Drag and drop all the required fields and enter the condition.

02621001709

Page 136

5.

specify the condition in criteria.

02621001709

Page 137

02621001709

Page 138

6.

Press the run button.! And press yes .

02621001709

Page 139

02621001709

Page 140

b.

(using SQL Query)

02621001709

Page 141

1.

Select create query in design view->SQL

02621001709

Page 142

2.

Press the run button.!

02621001709

Page 143

02621001709

Page 144

3.

click yes.

6. Insertion of new record


Using SQL query 1. Select create query in design view.

02621001709

Page 145

02621001709

Page 146

02621001709

Page 147

2.

Click on close.

02621001709

Page 148

02621001709

Page 149

3.

Right click on screen and select SQL view.

02621001709

Page 150

02621001709

Page 151

4. Enter the insert query.

02621001709

Page 152

02621001709

Page 153

5. Press the run button.!

02621001709

Page 154

6. Click Yes. 7. Save the query.


02621001709 Page 155

7. Ordering the records


a. using design view

02621001709

Page 156

1.

Select create query in design view.

02621001709

Page 157

02621001709

Page 158

02621001709

Page 159

2.

Select the required table and press add.

02621001709

Page 160

02621001709

Page 161

3.

Drag and drop the fields.

02621001709

Page 162

4.

Select ascending or descending in the sort row.

02621001709

Page 163

02621001709

Page 164

02621001709

Page 165

5.

Press run button!

02621001709

Page 166

02621001709

Page 167

b.

using sql query

02621001709

Page 168

1.

Select create query in design view.

02621001709

Page 169

02621001709

Page 170

2.

Click on close.

02621001709

Page 171

02621001709

Page 172

3.
02621001709

Right click on screen and select SQL view.


Page 173

02621001709

Page 174

4.

Enter the order by query.

02621001709

Page 175

02621001709

Page 176

5.

Press run button!

02621001709

Page 177

02621001709

Page 178

8. Updating a record
a. Using Design view

1. Select create query in design view.


02621001709 Page 179

02621001709

Page 180

02621001709

Page 181

2. Select the required table and press add.

02621001709

Page 182

02621001709

Page 183

3.Select query from menu bar->Update Query

02621001709

Page 184

02621001709

Page 185

4.Drag and Drop required fields.

02621001709

Page 186

02621001709

Page 187

5. Press run button !

02621001709

Page 188

b. 1.

Using SQL View

Select create query in design view.

02621001709

Page 189

02621001709

Page 190

2.

Click on close.

02621001709

Page 191

02621001709

Page 192

3.

Right click on screen and select SQL view.

02621001709

Page 193

02621001709

Page 194

4.

Enter the update query.

02621001709

Page 195

02621001709

Page 196

5.

Press run button!

02621001709

Page 197

02621001709

Page 198

02621001709

Page 199

1.

Select forms from object.

02621001709

Page 200

02621001709

Page 201

2.

Select Create forms by using wizard.

02621001709

Page 202

02621001709

Page 203

3.

Select table or query from drop down menu.

02621001709

Page 204

02621001709

Page 205

02621001709

Page 206

4.

select the fields to be included in the form.

02621001709

Page 207

02621001709

Page 208

5.
02621001709

click next.
Page 209

02621001709

Page 210

02621001709

Page 211

6.

Select the type of form and press next.

02621001709

Page 212

02621001709

Page 213

02621001709

Page 214

7.

Select the style of form.press next.

02621001709

Page 215

02621001709

Page 216

02621001709

Page 217

8.

Select the title. Press Finish.

02621001709

Page 218

02621001709

Page 219

02621001709

Page 220

02621001709

Page 221

1.

Select Reports from object menu.

02621001709

Page 222

02621001709

Page 223

2.

Select create report by using wizard.

02621001709

Page 224

02621001709

Page 225

3.

Select the table or query from drop down menu.

02621001709

Page 226

02621001709

Page 227

02621001709

Page 228

4.

Select the fields required for report.

02621001709

Page 229

02621001709

Page 230

02621001709

Page 231

5.

Press next.

02621001709

Page 232

02621001709

Page 233

02621001709

Page 234

6.

Select the group which is to be added. Click next.

02621001709

Page 235

02621001709

Page 236

02621001709

Page 237

7.

select wether sort the records.press next.

02621001709

Page 238

02621001709

Page 239

02621001709

Page 240

8.

Select the layout. press next.

02621001709

Page 241

02621001709

Page 242

02621001709

Page 243

02621001709

Page 244

9.

Select the layout style. Press next.

02621001709

Page 245

02621001709

Page 246

10.

Select the repot name and click on finish.

02621001709

Page 247

02621001709

Page 248

02621001709

Page 249

S-ar putea să vă placă și