Assignment 01 111191128
Assignment 01 111191128
Assignment
Course Title: Business Analytics
Course Code: CST 2321
Section: C
Submitted To
Ahmed Imran Kabir
Lecturer
School of Business and Economics
United International University
Submitted By
Md. Shamiur Rahman
ID: 111191128
1
Table of Contents
1 Introduction 4
2 Schema Diagram 5
3 Relationship Model 6
5 SQL Queries 8
6 Implementation 14
2
22th December, 2022
Lecturer
Dear Sir,
I pleased to prepare my report & submit to you on “ SQL Analysis”. It’s a great
opportunity to me to carry out the report under your assistance. This report couldn’t
have been finished without your direction. Please accept my apology for any errors
that could have crept into the report despite my best effort.
I would greatly appreciate it if you could shed some light on this report by sharing
your ideas and opinions. In addition, I would be happy to respond to any question if
you have any on any part of my report.
Thank you
Your sincerely,
3
Introduction
Here, A new student record system that is required to design schema diagram, an
entity relationship model ( ERM), Enhanced entity relationship diagram ( EERD),
Multiple SQL queries. Creating & Implementing a new student record system that
can store about students, staffs and courses is my responsibility for this report. New
students and staff can check and update their personal information and other things
using SQL queries.
4
Schema Diagram
1. Student
2. Staff
3. Class.
Course: Student id, faculty id number is the foreign key & course code is the primary
key.
5
Relationship Model:
1. One to One.
2. One to Many
3. Many to Many
To create this report I used entity relationship model ( ERM). It also related with
Primary Key( PK) & Foreign Key ( FK)
Primary Key:
Primary key means uniqueness of the table. 1st candidate key. Confirm the
uniqueness of the column.
Ex: Based on the Student & Staff table Student Id, Faculty Id number is the primary
key.
Foreign Key:
It’s mainly 2nd table candidate key. It mainly used to build a relationship between
the two tables.
6
Ex: In course table Student id & Faculty id number is the foreign key.
In this relationship model, I create five tables. Student, Course, Staff. Student &
Course are connected each other. They have many to many relationship. Based on
the relationship we create student has course table. On the other hand staff & course
are connected. They also have many to many relationship. So, here we also create
another table name is staff has course.
7
Forward Engineer:
Here I check the table relation successfully run or not. After I completing my tables
I move to the database & going forward engineering process. I skip the creation of
foreign keys, skip creation of FK indexes as well and also disable FK checks for
inserts. Finally I run it and successfully finished forward engineer.
SQL Queries:
SQL queries is very helpful for employees. Suppose, I’m working in a company and
I need find out some employees name & id number. In this case I use SQL queries.
Using SQL Queries it is very easy to find out the employee name & id. In SQL
queries we follow some step. The steps are:
8
SELECT. Here you choose the field that you want to show in the result.
FROM. Here which table you want to use.
Course:
9
Staff:
Student:
10
11
Here, I entry the data into the SQL data insert & click the apply and successfully
done.
12
13
Implementation:
When I’m doing this assignment I didn’t face any problem. First I have created 5
tables that represent the entity-relationship model (ERM).
1. Course
2. Student
3. Staff
4. Staff has courses
5. Student has courses.
But I face bit problem when I’m doing my SQL queries. 1st 2/3 times SQL queries
doesn’t run successfully. After little trying I can successfully run the SQL queries.
14