Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

BHARATI VIDYAPEETH’S

INSTITUTE OF COMPUTER APPLICATIONS &


MANAGEMENT
(Affiliated to Guru Gobind Singh Indraprastha University, Approved By
AICTE, New Delhi)
A-4, PaschimVihar, Rohtak Road, New Delhi-110063

PRACTICAL FILE

ADVANCED DATABASE
MANAGEMENT SYSTEMS

SUBMITTED TO: SUBMITTED BY:


Dr. Imran Khan Abhishek Agarwal
(Assistant Professor ) 00211604416
Semester-V, Sec-I
INDEX

S.NO. PRACTICAL PAGE NO. SIGN


1. Twitter 3-7
2. E Commerce 7-10
Case Study - 1
Twitter

Description

Twitter is on online news and social networking site where people communicate in short
messages called tweets. Tweeting is sending short messages to anyone who follows
you on Twitter, with the hope that your messages are useful and interesting to someone
in your audience. Another description of Twitter and tweeting might be microblogging.

Twitter is known as a micro-blogging site. Blogging has been around for some time.
Usually blogging consists of people setting up basic websites where they write about
whatever they want, whether it be politics, sport, cooking, fashion etc. Posting a
message is known as a tweet. People make connections by following other people’s
twitter feeds. Once you click follow, anything that person or organization says will
appear on your timeline. You can tweet a person by putting the @ symbol before
their username.

Some people also use Twitter to discover interesting people and companies online and
to follow their tweets for as long as they are interesting.

Steps for creating Database Design

Step 1: Identify all entities and their attributes.


Entity Attributes
User user_id, name, phone, email, password, country, dob, profile_image,
no_of_tweets, no_of_following, no_of_followers, date_of_joining
Tweet tweet_id, text, mention_user_id
Media media_id, url
Message message_id, to_user_id, text
Step 2: Create Relationship matrix/table or Entity-Entity matrix.
User Tweet Media Message
User follows writes Sends
Tweet writes Has
Media has Has
Message sends Has

Step 3: Design Entity-Relationship diagram.


Step 4: Design Relational model.
Step 5: Create Relational Database design.
Case Study : E Commerce

Problem Statement:
This project gives detail about how a customer interacts with an e commerce site.A customer
needs to create an account to shop online. A customer can place items in the shopping cart and
wish-list and can avail the facility of ordering the items. User can view/search products by
category. User can add/remove items in cart. User can view his orders. Every order has one or
more products. Each order has a generated invoice which is paid by some payment method. Each
order has its specific shipment details.

Entities:

Entity Attributes Description


Category Cat_name, cat_desc Describes the basic information
about the category of the
product.
Customer Cust_name, cust_id, username, email_id, Describes the basic information
address, order_id about the Customer
Invoice Invoice_date, details Describes information related
about the invoice of the
cutomer’s shipment.
Orders Order_date, total amount, status, Describes information related
invoice_id to the orders placed by the
customer.
Payment Type, bank_details, invoice_id Describes information related
to the payment for the cart of
customer.
Products Production_date, prod_quantity, Describes information related
prod_price, prod_name, cat_id , order_id to a product
Shipment Ship_address, ship_date, order_id, Describes information related
invoice_id to the shipment of the product.
Relationship Matrix:

Customer Category Products Orders Shipment Invoice Payment


Customer N/A N/A Selects Places N/A N/A Makes
Category N/A N/A Consists N/A N/A N/A N/A
Products Selects Consists N/A Contains N/A N/A N/A
Orders Places N/A Contains N/A Shipped Generates N/A
Shipment N/A N/A N/A Shipped N/A Has N/A
Invoice N/A N/A N/A Generates Has N/A Paid by
Payment Makes N/A N/A N/A N/A Paid by N/A

Entity Relationship Diagram:


Queries:

1. Display order details of customer with ID=3

Select * from orders where cust_id=3;

2. Display product name and price where Category=”Electronics”

Select p.Prod_name,p.Prod_price from Products p, Category c where


p.Prod_catIegoryID=c.Cat_id and c.Cat_Name='Electronics';

3. Display no of orders placed by Customer with ID=1

Select count (order_id) from Orders where cust_id=1;

4. List types of order with their count.

Select count (order_id) AS count, order_status from orders group by order_status;

You might also like