系统设计与数据库原理 作业四 Data Modelling using PowerDesigner

简介: 系统设计与数据库原理 作业四 Data Modelling using PowerDesigner

Purpose of Experiment purpose and Requirements


Transform the following ER diagram into Relations and Create the required tables using Oracle / MySQL: (with Primary Key, Foreign Key if any, Data types, Width, Domain and Integrity Constraints )


Identify the following

1) Identify the type of relationship (1:1, 1:m, m:m)

2) Identify the cardinality (Min, Max)

3) Primary Key


EER diagram 1):

7938d8b03f6b42e090e7e51f8f0e63c2.png



①Employee → Mechanic 1:m

②Employee → Salesman 1:m

③Mechanic → RepairJob 1:m

④RepairJob → Cars m:1

⑤ Salesman → Clients 1:m

⑥ Salesman → Cars 1:m


①Mechanic does RepairJob is (0,m)

②RepairJob repairs is (1,m)

③Cars is repaired by RepairJob is (0,1)

④Salesman buys is (0,m)

⑤Clients buys is (0,m)

⑥Clients sells is (0,m)

⑦Client (0,m)


The underlined one is primary key

①Mechanic (MNumber,MName)

②RepairJob (Description, RepairNumber,MNumber,License,Cost)

③RepairCost (RepairNumber,MNumber,License,Parts,Work)

④Car (License,Manufacturer,Model,Year);

⑤Salesman (SNumber,SName);

⑥Client (CID,CName,Address);

⑦ClicentPhone (CID,Phone);

⑧Buys(SNumber,CID,License,Price,Date,Value);

⑨Sells(SNumber,CID,License,Date,Value,Commission);


I use the following MySQL code to establish these tables:


CREATE TABLE `Mechanic` (
    `MNumber` INT(4) NOT NULL PRIMARY KEY,
    `Name` VARCHAR(20) NOT NULL
);
CREATE TABLE `Salesman` (
    `SNumber` INT(4) NOT NULL PRIMARY KEY,
    `Name` VARCHAR(20) NOT NULL
);
CREATE TABLE `RepairJob` (
    `RepairNumber` INT(4) NOT NULL PRIMARY KEY,
    `MNumber` INT(4),
    FOREIGN KEY (MNumber)
        REFERENCES Mechanic (MNumber),
    `License` VARCHAR(20),
    FOREIGN KEY (License)
        REFERENCES car (License),
    `Description` VARCHAR(20) NOT NULL,
    `Parts` VARCHAR(20) NOT NULL,
    `Work` VARCHAR(20) NOT NULL
);
CREATE TABLE `Client` (
    `ID` INT(4) NOT NULL PRIMARY KEY,
    `Phone` INT(11) NOT NULL,
    `Address` VARCHAR(20) NOT NULL,
    `Name` VARCHAR(20) NOT NULL
);
CREATE TABLE `Phone` (
    `ID` INT(4),
    FOREIGN KEY (ID)
        REFERENCES Client (ID),
    `Phone` INT(11) NOT NULL
);
CREATE TABLE `Car` (
    `License` VARCHAR(20) NOT NULL PRIMARY KEY,
    `SNumber` INT(4),
    FOREIGN KEY (SNumber)
        REFERENCES Salesman (SNumber),
    `ID` INT(4),
    FOREIGN KEY (ID)
        REFERENCES Client (ID),
    `Manufacturer` VARCHAR(10) NOT NULL,
    `Model` VARCHAR(10) NOT NULL,
    `Year` DATE NOT NULL
);
CREATE TABLE `Buys` (
    `SNumber` INT(4),
    FOREIGN KEY (SNumber)
        REFERENCES Salesman (SNumber),
    `License` VARCHAR(20) NOT NULL,
    FOREIGN KEY (License)
        REFERENCES Car (License),
    `ID` INT(4) NOT NULL,
    FOREIGN KEY (ID)
        REFERENCES Client (ID),
    `Price` INT(10) NOT NULL,
    `Date` DATE NOT NULL,
    `Value` INT(10) NOT NULL
);
CREATE TABLE `Buys` (
    `SNumber` INT(4),
    FOREIGN KEY (SNumber)
        REFERENCES Salesman (SNumber),
    `License` VARCHAR(20) NOT NULL,
    FOREIGN KEY (License)
        REFERENCES Car (License),
    `ID` INT(4) NOT NULL,
    FOREIGN KEY (ID)
        REFERENCES Client (ID),
    `Commission` INT(10) NOT NULL,
    `Date` DATE NOT NULL,
    `Value` INT(10) NOT NULL
);


Case Study


A relational database is to be designed for a medium sized Company dealing with developing application software. The Company delivers various products to its customers ranging from a single application program to customized software. The Company employs various experts, consultants and supporting staff. All personnel are employed on long-term basis, i.e. there are no short-term or temporary staffs.


Although the Company is somehow structured for administrative purposes (that is, it is divided into departments headed by department managers) all projects are carried out in an inter-disciplinary way. For each project has a Start date when a project team is selected, grouping employees from different departments, and a Project Manager (also an employee of the Company) is appointed who is entirely and exclusively responsible for the control of the project, quite independently of the Company’s hierarchy. The following is a brief statement of some facts and policies adopted by the Company.


Entities

• Department

• Employee

• Skills

• Team

• Customers

• Product

• Projects

• Spouse

• Dependent(children of employee)


Relationships

• Employees work for different department headed by a Manager

• Employee has Spouse and Dependent (child)

• Each department manages many employees.

• Employees are divided into many teams

• Each Team manages a project

• Each Department is Headed by a Department Manager

• Each Employees belongs to one team

• A Project is headed by Project Team

• Skills are used in projects


Draw the Logical Data Model and Physical Data Model for Oracle DBMS using Power Designer


Logical Data Model


2ebdd2df2e28457db9f050e576581735.png


Physical Data Model:


eca4bc8c6fa243b6bd2f96da61b1166a.png

相关文章
|
21天前
|
存储 人工智能 Cloud Native
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
在9月20日2024云栖大会上,阿里云智能集团副总裁,数据库产品事业部负责人,ACM、CCF、IEEE会士(Fellow)李飞飞发表《从数据到智能:Data+AI驱动的云原生数据库》主题演讲。他表示,数据是生成式AI的核心资产,大模型时代的数据管理系统需具备多模处理和实时分析能力。阿里云瑶池将数据+AI全面融合,构建一站式多模数据管理平台,以数据驱动决策与创新,为用户提供像“搭积木”一样易用、好用、高可用的使用体验。
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
|
1月前
|
缓存 算法 关系型数据库
Mysql(3)—数据库相关概念及工作原理
数据库是一个以某种有组织的方式存储的数据集合。它通常包括一个或多个不同的主题领域或用途的数据表。
56 5
Mysql(3)—数据库相关概念及工作原理
|
22天前
|
存储 Java 关系型数据库
在Java开发中,数据库连接是应用与数据交互的关键环节。本文通过案例分析,深入探讨Java连接池的原理与最佳实践
在Java开发中,数据库连接是应用与数据交互的关键环节。本文通过案例分析,深入探讨Java连接池的原理与最佳实践,包括连接创建、分配、复用和释放等操作,并通过电商应用实例展示了如何选择合适的连接池库(如HikariCP)和配置参数,实现高效、稳定的数据库连接管理。
42 2
|
1月前
|
SQL 关系型数据库 数据库
SQL数据库:核心原理与应用实践
随着信息技术的飞速发展,数据库管理系统已成为各类组织和企业中不可或缺的核心组件。在众多数据库管理系统中,SQL(结构化查询语言)数据库以其强大的数据管理能力和灵活性,广泛应用于各类业务场景。本文将深入探讨SQL数据库的基本原理、核心特性以及实际应用。一、SQL数据库概述SQL数据库是一种关系型数据库
64 5
|
1月前
|
存储 人工智能 Cloud Native
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
阿里云瑶池在2024云栖大会上重磅发布由Data+AI驱动的多模数据管理平台DMS:OneMeta+OneOps,通过统一、开放、多模的元数据服务实现跨环境、跨引擎、跨实例的统一治理,可支持高达40+种数据源,实现自建、他云数据源的无缝对接,助力业务决策效率提升10倍。
|
1月前
|
SQL 关系型数据库 MySQL
sql注入原理与实战(三)数据库操作
sql注入原理与实战(三)数据库操作
sql注入原理与实战(三)数据库操作
|
2月前
|
存储 人工智能 Cloud Native
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
阿里云数据库重磅升级!元数据服务OneMeta + OneOps统一管理多模态数据
|
1月前
|
Java API 数据库
Data jpa 增删改查的方法分别有哪些
Data jpa 增删改查的方法分别有哪些
|
1月前
|
SQL 存储 Java
sql注入原理与实战(二)数据库原理
sql注入原理与实战(二)数据库原理
|
3月前
|
消息中间件 Kafka 数据库
深入理解Kafka的数据一致性原理及其与传统数据库的对比
【8月更文挑战第24天】在分布式系统中,确保数据一致性至关重要。传统数据库利用ACID原则保障事务完整性;相比之下,Kafka作为高性能消息队列,采用副本机制与日志结构确保数据一致性。通过同步所有副本上的数据、维护消息顺序以及支持生产者的幂等性操作,Kafka在不牺牲性能的前提下实现了高可用性和数据可靠性。这些特性使Kafka成为处理大规模数据流的理想工具。
86 6
下一篇
无影云桌面