0% found this document useful (0 votes)
3 views14 pages

Practical 6

Uploaded by

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

Practical 6

Uploaded by

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

Practical 6A

Create and open the database with multiple tables; Identify the one to one relationships
within the database and to produce reports bases on those relationships

Create the following tables


student

Student_details

teacher

Teacher_details
Add 5 records in all the 4 tables

Make sure sid of student should match the sid of student_details

Make sure tid of teacher should match the tid of teacher_details


Once done adding the values
Go to ribbon tab
Click on Database tools
Select Relationships

Once you click on relationships below window will be open, add all the tables from the
window by double clicking on it, once done adding close the window

It should look like this


Step1 )Now taking student and student_details

Drag the sid of student to stu_id of student_details


Once you drag below window will open, check on enforce referential integrity, and click
on create

Once you create you can see that we’ve successfully created one to one relationship
between our student and student_details

Follow the Step 1 to make one to one relationship between teacher and teacher_details

You’ll see the following output on your screen after successfully following the steps
Now press ctrl+s to save the relationship
Step 2) creating a query for student and student_details and making the report based on
that query

Click on create from ribbon tab


Under queries
Select query Design

Once you click on that following window will open, double click on student and
student_details to add that in the field
As you can see we’ve sid in student and stu_id in student_details.
So we’ve to select only sid and rest all the fields, by double clicking on it

So your below table should look like this

Once done save the query


Step 3) creating the report based on the query

Click on the query you’ve created


From the ribbon tab
Go to report
Under report select 1 option

Once you click on the report your report will open, save the report by any name

Now we’ve created the report for student and student_details


Repeat step 3 and step 4 and create the report for teacher and teacher_details
**Note as tid is common in both you’ll select only 1 tid

Hence we’ve created the report for teacher and teacher_details

Practical 6B

Create and open a database with multiple tables; Identify the one to one relationships
within the database and to produce reports based on those queries

**must have the knowledge of practical 6A

Create the following tables

course

enrollment
Student_details

Enter 5 records in all the three tables using direct method

Once done adding the values


Go to ribbon tab
Click on Database tools
Select Relationships
Once you click on relationships below window will be open, add course and enrollment
from the window by double clicking on it, once done adding close the window

Drag the cid of course to cid of enrollment


Once done, a pop up will open, click on enforce referential integrity
Click on create
Now create the query and create the report based on that query

Click on create from ribbon tab


Under queries
Select query Design

Once you click on that following window will open, double click on course and
enrollment to add that in the field

Now you’ll add all the fields in the same way we’ve done in step2 of practical 6A
In this as you can see cid is common in both course and enrollment you’ll only add 1 cid
Your table should look like this

Once done save the query


And create the report based on that query

Hence we’ve successfully created the report based on the query


Practical 6C

Create and Open a database with multiple tables. Identify the Many to Many
relationships within the database and to produce report based on those relationships

Using the same table we created in practical 6B

Once done adding the values


Go to ribbon tab
Click on Database tools
Select Relationships

Once you click on relationships below window will be open, add course, enrollment,
student_details from the window by double clicking on it, once done adding close the
window
Now drag the cid from course to cid of enrollment
Click on referential integrity
Click on create

Similary
Drag the sid from enrollment to sid of student_details
Click on referential integrity
Click on create

Your table will look like this

Now create the query and create the report based on that query

Click on create from ribbon tab


Under queries
Select query Design

Once you click on that following window will open, double click on course and
enrollment to add that in the field

Now you’ll add all the fields in the same way we’ve done in step2 of practical 6A
Save the query and create the report based on that query

Final output

You might also like