Create an e-r diagram of entities, attributes & relationship

Assignment Help Database Management System
Reference no: EM13948372

Using the script file below to create an E-R diagram of the entities, attributes and relationship.

# use the "my_database" database
USE my_database;

# create a table called "items" with 3 records
CREATE TABLE IF NOT EXISTS items
(
id INT PRIMARY KEY,
vendor INT NOT NULL,
name CHAR(20) NOT NULL,
price DECIMAL(6,2) NOT NULL
);
INSERT INTO items (id, vendor, name, price)
VALUES (601, 2, "Elephants", 147.50);
INSERT INTO items (id, vendor, name, price)
VALUES (602, 2, "Reindeers", 123.00);
INSERT INTO items (id, vendor, name, price)
VALUES (603, 1, "Alligators", 185.00);

# create a table called "vendors" with 2 records
CREATE TABLE IF NOT EXISTS vendors
(
id INT PRIMARY KEY,
name CHAR(20) NOT NULL
);
INSERT INTO vendors (id, name) VALUES (1, "Alpha Inc");
INSERT INTO vendors (id, name) VALUES (2, "Zeta Inc");

# create a table called "orders" with 3 records
CREATE TABLE IF NOT EXISTS orders
(
num INT PRIMARY KEY,
item INT NOT NULL,
qty INT NOT NULL
);
INSERT INTO orders (num, item, qty) VALUES (2805, 603, 10);
INSERT INTO orders (num, item, qty) VALUES (2806, 603, 5);
INSERT INTO orders (num, item, qty) VALUES (2807, 601, 10);

# display order number, quantity, item name, vendor
# and total order value of order number 2805
SELECT orders.num AS Number,
orders.qty AS Qty,
items.name AS Toy,
vendors.name AS Vendor,
items.price * orders.qty AS Total
FROM items, vendors, orders
WHERE vendors.id = items.vendor
AND items.id = orders.item
AND orders.num = 2805;

# delete these sample tables
DROP TABLE IF EXISTS items;
DROP TABLE IF EXISTS vendors;
DROP TABLE IF EXISTS orders;

Attachment:- ER.doc

Reference no: EM13948372

Questions Cloud

Complete a job requirements job analysis : Complete a job requirements job analysis on a position with which you are familiar. Focus on the specifics tasks of the associated KSAOs that lead to success in meeting the tasks.  (showing detail both in the tasks and the KSAOs type, proficiency, et..
Create table command, and modify it to create a new table : Start with this CREATE TABLE command, and modify it to create a new range_partitioned table named CH07EMPLOYEE_RANGE that contains the same column as the employee table.
Business requirements and design requirements : Why is it important to use modular approach for designing Networks? Could you anticipate what problems can occur if such methods are not used? Describe your response in two paragraphs.
Calculate design effect for the mean of that key variable : A medical practice has record for N=900 patients. A simple random sample of n=300 was selected, and 210 of the sample patients had private health insurance. Estimate the percentage of patients with private health insurance and the standard error of..
Create an e-r diagram of entities, attributes & relationship : Using the script file below to create an E-R diagram of the entities, attributes and relationship.
What should yahoo do about the situation in laffaire yahoo : In your opinion, what should Yahoo do about the situation in L'Affaire Yahoo? Should it make concessions to the French government
Calculate the margin and turnover ratios for last year : Seere Company provided the following income statement for last year. Compute average operating assets. Compute the margin and turnover ratios for last year. Compute ROI.
How world you compare with nike : What are the pros, cons and risks associated with Nike's core marketing strategy? If you were Adidas, how world you compare with Nike
Practical vs theoretical education in health professionals : Issue in health professions education, review the literature pertaining to the issue, analyze the issue, and discuss its effect on health professions education. In writing 8-10 Pages font size 12 double space, including refrances APA style.

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd