系统设计与数据库原理 作业四 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

相关文章
|
2月前
|
人工智能 运维 数据挖掘
瑶池数据库Data+AI驱动的全栈智能实践开放日回顾
阿里云瑶池数据库重磅推出“Data+AI能力家族”,包括DTS AI数据准备、Data Agent系列智能体及DMS MCP统一数据访问服务,重构数据与AI协同边界。通过智能化工具链,覆盖数据全生命周期,提升企业数据开发、分析、治理与运维效率,降低技术门槛,激活数据资产价值,助力企业迈向全栈智能新时代。
|
3月前
|
人工智能 运维 数据挖掘
瑶池数据库开放日:全新发布Data+AI能力家族,赋能企业全栈智能实践
近日,阿里云瑶池数据库生态工具产品重磅升级,推出“Data+AI能力家族”,并举办了为期3天的全栈智能实践开放日活动。发布会上首次公开了 “Data Agent for Analytics、Data Agent for Meta、DAS Agent”等瑶池数据库Data Agent系列能力,以工具智能化 × 智能化工具的双引擎重构数据与AI的协同边界,揭秘AI时代数据价值释放的全新路径。
|
10月前
|
存储 人工智能 Cloud Native
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
在9月20日2024云栖大会上,阿里云智能集团副总裁,数据库产品事业部负责人,ACM、CCF、IEEE会士(Fellow)李飞飞发表《从数据到智能:Data+AI驱动的云原生数据库》主题演讲。他表示,数据是生成式AI的核心资产,大模型时代的数据管理系统需具备多模处理和实时分析能力。阿里云瑶池将数据+AI全面融合,构建一站式多模数据管理平台,以数据驱动决策与创新,为用户提供像“搭积木”一样易用、好用、高可用的使用体验。
云栖重磅|从数据到智能:Data+AI驱动的云原生数据库
|
7月前
|
缓存 NoSQL Redis
Redis原理—2.单机数据库的实现
本文概述了Redis数据库的核心结构和操作机制。
Redis原理—2.单机数据库的实现
|
8月前
|
JavaScript NoSQL Java
基于SpringBoot+Vue的班级综合测评管理系统设计与实现(系统源码+文档+数据库+部署等)
✌免费选题、功能需求设计、任务书、开题报告、中期检查、程序功能实现、论文辅导、论文降重、答辩PPT辅导、会议视频一对一讲解代码等✌
|
8月前
|
JavaScript NoSQL Java
基于SpringBoot+Vue实现的大学生体质测试管理系统设计与实现(系统源码+文档+数据库+部署)
面向大学生毕业选题、开题、任务书、程序设计开发、论文辅导提供一站式服务。主要服务:程序设计开发、代码修改、成品部署、支持定制、论文辅导,助力毕设!
|
10月前
|
JSON Java 关系型数据库
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
在Java中,使用mybatis-plus更新实体类对象到mysql,其中一个字段对应数据库中json数据类型,更新时报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
1090 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
|
10月前
|
存储 缓存 网络安全
南大通用GBase 8s 数据库 RHAC集群基本原理和搭建步骤
南大通用GBase 8s 数据库 RHAC集群基本原理和搭建步骤
|
11月前
|
缓存 算法 关系型数据库
Mysql(3)—数据库相关概念及工作原理
数据库是一个以某种有组织的方式存储的数据集合。它通常包括一个或多个不同的主题领域或用途的数据表。
451 5
Mysql(3)—数据库相关概念及工作原理