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

  Your supervisors and customers are very impressed with the

your supervisors and customers are very impressed with the database you have put together. however there is still that

  Part a sql queriesuse the classicmodels database

part a sql queriesuse the classicmodels database classicmodels.sql from the itc114 interact resources site.answer the

  Diagram of the table containing the initial data

Diagram of the table containing the initial data - state how you checked that the XML file is well-formed and what messages are sent if it is not well-formed?

  Build an uml model in microsoft visio

Neatness of your diagram, please use the concepts of model, package, and sub-system well in the Visio model. Create both your diagrams under the static model from the model explorer in Visio.

  Question 1there are six major types of information systems

question 1there are six major types of information systems which organisations use in their operations. discuss how

  Write the sql code that will create the table structure

Write the SQL code that will create the table structure for a table named EMP

  Develop an e-r diagram and class diagram

Develop an E-R diagram, class diagram, or a data flow diagram that effectively represents the data that are required for your application or system.

  Write a join query that for every order placed on september

Write a join query that for every order placed on September 5, 1998, (use '05-SEP-1998') will list the order number and order date along with the customer number, last name, and first name of the customer who placed the order

  Create a schema that supports the company business

Create a schema that supports the company's business and processes. Explain and support the database schema with relevant arguments that support the rationale for the structure

  Case study-zen chiropractic clinic

Display the full details for the cheapestservices provided by ZC2 -  The Case Study-Zen Chiropractic Clinic

  Implement the entity relationship model

Implement the entity relationship model provided in the sample solution of Assignment - Map the ERD into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations meet 3NF. There is no need to show your working.

  Simple mobile database-replication and mobile database strat

For this assignment, you will create a simple mobile database application using any mobile database of your choice consisting of one or two tables. You may use the database you created in another unit or you may choose to create a new database to ..

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