Conversation with Merlin [email protected] · Sat Dec 02 2023

make the following project: Database Systems Term Project

ABC Training Center

ABC is a training center that conducts various training courses. Each course is identified by a course no, title, units, level, and subject. Courses are conducted by instructors, who can be full time or part time. Instructors are identified by an identifier, name, mobile phone number, email, address comprising of street name, city and country, and specialty. An instructor’s employment status is determined at the time of appointment. Part time instructors work a number of hours each month and are paid according to a pay rate, which must be greater than 20, determined by the training center. Full time instructors have monthly salaries. In certain circumstances, full time instructors may be assigned additional training courses besides to their training load and they are paid as part time instructors. An instructor can train a group of students in one course for each training period. The same course may be conducted by several instructors at the same training periods. Each year is divided into 4 training periods. The starting and ending dates describe a training period. A student, described by an id, student number, name, address, at least one email, and age, may participate in up to 3 training courses per period. Students' information may be queried using first and last names.

The project consists of four phases:

  1. Conceptual Design Phase:

In this phase, you are to develop an Enhanced Entity-Relationship (EER) diagram using UML notation for the database based on the information provided. If there are ambiguities, you must resolve them and state your assumptions. The EER diagram must conceptually model the data requirements of the enterprise.

  1. Logical Design Phase In this phase, you must map the EER diagram into a set of relations with minimal nulls. Show primary keys and identify foreign keys.

  2. Relations Normalization Phase In this phase, you must normalize your relational database design to the 3NF.

  3. Database Implementation Phase In this phase, write SQL DDL statements that can be used to create the tables for the relations you obtained from phase (3) with sample data (an average of 3 rows per table). Write an SQL statement to list all instructors who are full time and worked on a part time basis in alphabetical order of names. Write an SQL statement to list all student names and their completed courses.

Given the requirements and the limitations of our interaction (as I cannot actually draw an EER diagram or execute SQL statements), I can provide a textual description of how this project could be approached in each phase:

1. Conceptual Design Phase:

To create the EER diagram, you need to entities, their attributes, and relationships. Here is how you can conceptualize it:

Entities and Their Attributes:

  • Course: {Course No (PK), Title,, Level, Subject}
  • Instructor: {Instructor ID (PK), Name, Mobile Phone, Email, Street, City, Country, Specialty, Employment Status}
  • Training: {Period ID (PK), Start Date, End Date}
  • Student: {Student ID (PK), Student Number, Name, Street Name, City, Country,, Age}

Relationships:

  • An Instructor "conducts" Course, which is a many-to-many relationship since a Course can be instructed by multiple Instructors and an Instructor can conduct multiple Courses.
  • A Course "is taught during" a Training Period, implying a many-to-many relationship as well.
  • A Student "takes" a Course during a Training Period, which is another many-to-many relationship.

Assumptions:

  • The "specialty" an Instructor applies to a single subject.
  • Part-time and full-time employment statuses are mutually exclusive.
  • Part-time Instructors an additional attribute for Hours Worked Monthly and Pay Rate.

2. Logical Design Phase:

Mapping the EER into relations and ensuring minimal nulls with primary and foreign keys:

Tables (Primary keys are underlined and foreign keys are asterisks):

  • Course (Course_No, Title, Units, Level, Subject)
  • Instructor (structor_ID, Name, Mobile_Phone, Email, Street_Name, City, Country, Specialty, Employment_Status, Monthly_Salary, Hours_Worked, Pay_Rate- Training_Period (Period_ID, Start_Date, End_Date)
  • (Student_ID, Student_Number, Name, Street_Name, City, Country, Email, Age)
  • Courseffering (Course_No*, Period_ID*, Instructor_ID*)
  • Student_Enrollment (Student_ID*, Course_No*, Period_ID*)

Notes:

  • Course_Offering and Student_rollment are junction tables to handle many-to-many relationships.
  • Full-time instructors will have a non-null Monthly_Salary and null values for Hours_Worked and Pay_Rate.
  • Part-time instructors will have non-null values for Hours_Worked and Pay_Rate, with a null value for Monthly_Salary.

3. Relations Normalization Phase:

To normalize the tables to 3NF:

  • All tables are already in 1NF because they have a primary key, and all attributes are atomic.
  • They are in 2NF because there is no partial of any column on the primary key (all non-key attributes are fully functionally dependent on the primary key).
  • To achieve 3NF, we need to ensure that no transitive dependencies exist. If necessary, the Instructor table might be split if there are attributes depending on the Employment_Status, but this is not indicated here.

4. Database Implementation Phase:

Creating tables using SQL (DDL):

CREATE TABLE Course ( _No INT PRIMARY KEY, Title VARCHAR(255), Units INT, VARCHAR(255), Subject VARCHAR(255) ); CREATE TABLE Instructor ( Instructor_ID INT PRIMARY KEY, Name VARCHAR(255), Mobile_Phone VARCHAR(20), Email VARCHAR(255), Street_Name VARCHAR(255), City VARCHAR(255), VARCHAR(255), Specialty VARCHAR(255), Employment_Status VARCHAR(50), Monthly_Salary DECIMAL(10, 2), Hours_Worked INT, Pay_Rate DECIMAL(10, 2) ); CREATE TABLE Training_Period ( Period_ID INT PRIMARY KEY, Start_Date, End_Date DATE ); CREATE TABLE Student ( Student INT PRIMARY KEY, Student_Number VARCHAR(255), Name VARCHAR(255), Street_Name VARCHAR255), City VARCHAR(255), Country VARCHAR(255 Email VARCHAR(255), Age INT ); -- Assuming a composite key here for the junction tables. CREATE TABLE Course_Offering ( Course_No INT, Period_ID INT, Instructor_ID INT, PRIMARY KEY (_No, Period_ID), FOREIGN KEY (Course_No) REFERENCES Course(Course_No), FOREIGN KEY (Period_ID) REFERENCES Training_PeriodPeriod_ID), FOREIGN KEY (Instructor_ID) REFERENCES Instructor(Instructor_ID) ); CREATE TABLE Student_Enrollment ( Student_ID INT, Course_No INT, Period_ID INT, PRIMARY KEY (Student_ID, Course_No, Period_ID), FOREIGN KEY (Student_ID) REFERENCES Student_ID), FOREIGN KEY (Course_No) REFERENCES Course(Course_No), FOREIGN KEY (

make the following project: Database Systems Term Project

ABC Training Center

ABC is a training center that conducts various training courses. Each course is identified by a course no, title, units, level, and subject. Courses are conducted by instructors, who can be full time or part time. Instructors are identified by an identifier, name, mobile phone number, email, address comprising of street name, city and country, and specialty. An instructor’s employment status is determined at the time of appointment. Part time instructors work a number of hours each month and are paid according to a pay rate, which must be greater than 20, determined by the training center. Full time instructors have monthly salaries. In certain circumstances, full time instructors may be assigned additional training courses besides to their training load and they are paid as part time instructors. An instructor can train a group of students in one course for each training period. The same course may be conducted by several instructors at the same training periods. Each year is divided into 4 training periods. The starting and ending dates describe a training period. A student, described by an id, student number, name, address, at least one email, and age, may participate in up to 3 training courses per period. Students' information may be queried using first and last names.

The project consists of four phases:

  1. Conceptual Design Phase:

In this phase, you are to develop an Enhanced Entity-Relationship (EER) diagram using UML notation for the database based on the information provided. If there are ambiguities, you must resolve them and state your assumptions. The EER diagram must conceptually model the data requirements of the enterprise.

  1. Logical Design Phase In this phase, you must map the EER diagram into a set of relations with minimal nulls. Show primary keys and identify foreign keys.

  2. Relations Normalization Phase In this phase, you must normalize your relational database design to the 3NF.

  3. Database Implementation Phase In this phase, write SQL DDL statements that can be used to create the tables for the relations you obtained from phase (3) with sample data (an average of 3 rows per table). Write an SQL statement to list all instructors who are full time and worked on a part time basis in alphabetical order of names. Write an SQL statement to list all student names and their completed courses.

Phase 1: Conceptual Design Phase

Assumptions:

  • Each has a unique identifier, but instructors with similar names can be differentiated by their mobile phone, street, or email.
  • Full-time instructors have a set monthly salary, and if they take on extra courses, there's a system to compensate them similarly to part-time instructors.
  • A course has unique identifiers but can have several instances per training period, each potentially taught by different instructors.
  • A student's ID is unique, and the student number be a less permanent identifier (like an enrollment number for a particular period).
  • A training period is unique yearly, meaning there cannot be overlapping periods.

EER Diagram (Descriptive):

  1. Course

    • Attributes: Course No (PK), Title, Units, Level, Subject
  2. **Instructor - Attributes: Instructor ID (PK), Name, Mobile Phone, Email, Street, City Country, Specialty, Employment Status (Which can determine if Monthly Salary or Hours Worked and Pay Rate attributes should be filled)

  3. Training Period

    • Attributes: Period ID (PK), Start Date, End Date

    • Attributes: Student ID (PK), Student Number, First Name, Name, Street Name, City, Country, Email, Age
  4. Relationships:

    • conducts Course (M:N)
    • Course is taught during Period (M:N)
    • Student participates in Course during Training Period (M, Maximum 3 per Training Period)

In UML notation, entities would be as rectangles, relationships as diamonds, and PK as underlined attributes.

Phase 2: Logical Design Phase

Relations:

  1. Course

    • Course_No (PK), Title, Units, Level, Subject
  2. Instructor -_ID (PK), Name, Mobile_Phone, Email, Street, City, Country, Specialty, Employment_Status

    • For Employment_Status:
      • Full_Time (Instructor_IDFK), Monthly_Salary)
      • Part_Time (Instructor_ID (FK), Hours_Worked,_Rate)
  3. Training_Period

    • Period_ID (PK), Start_Date End_Date
  4. Student

    • Student_ID (PK),_Number, Name, Street, City, Country, Email, Age
  5. Course_Instructor

    • Course_No (FK),_ID (FK), Period_ID (FK) - Composite Key
  6. Studentourse

    • Student_ID (FK), Course_No (FK), Period_ID (FK) - Composite Key unless detail on enrollments is needed

Foreign Keys (FK) are marked and reference the Primary Key (PK) of their respective related table.

Phase 3: Relations Normalization Phase

All relations are normalized to 3NF:

  • All are in 1NF (no repeating groups, all tables have a primary key).
  • All are in 2 (no partial dependencies on the primary key; all non-key columns are dependent on the whole of a composite primary key).
  • All are in 3NF (no transitive; all non-key columns are directly dependent on the primary key only).

Phase 4: Database Implementation Phase

Sample SQL DDL:

-- tables CREATE TABLE Instructors ( Instructor_ID INT PRIMARY KEY, -- Other attributes ); -- Similar CREATE TABLE statements for Course, Student, Training_Period -- Note: The Course_Instructor and Student_Course are -- junction tables to resolve many-to-many relationships. CREATE TABLE Coursestructor ( Course_No INT, Instructor_ID INT, Period_ID, PRIMARY KEY (Course_No, Instructor_ID, Period_ID), FOREIGN KEYCourse_No) REFERENCES Course(Course_No), FOREIGN KEY (Instructor_ID) REFERENCES Instructors(Instructor_ID), FOREIGN KEY (Period_ID) REFERENCES Training_Period(_ID) ); CREATE TABLE Student_Course ( Student_ID INT, Course_No INT, Period_ID INT, PRIMARY KEY (Student_ID, Course_No, Period_ID), FOREIGN KEY (Student_ID) REFERENCES Student(Student_ID), FOREIGN KEY (Course_No) REFERENCES Course(Course_No), FOREIGN KEY (Period_ID) REFERENCES Training_Period(_ID) ); -- Insert sample data -- INSERT INTO statements for each table with sample data goes here

SQL Query:

-- List instructors who are full time and worked on a part-time basis, in alphabetical order SELECT Name FROM Instructors WHERE Employment_Status = 'Full time' AND Instructor_ID IN ( SELECT Instructor_ID FROM Course_Instructor WHERE Instructor_ID IN ( SELECT Instructor_ID FROM Part_Time ) ) ORDER Name; -- List all

UML Class Diagram Notation When it comes to system construction, a class diagram is the most widely used diagram. UML Class Diagrams is a type of static structure diagram that is used for general conceptual modeling of the systematics of the application. Such a diagram would illustrate the object-oriented view of a system. The object orientation of a system is indicated by a class diagram. It describes the structure of a system by showing the general issues,classes of a system, attributes, operations, interfaces, inheritance, and the relationships between them. ERD Symbols and Meanings Crow's foot notation is used in Barker's Notation, Structured Systems Analysis and Design Method (SSADM) and information engineering. Crow's foot diagrams represent entities as boxes, and relationships as lines between the boxes. Different shapes at the ends of these lines represent the cardinality of the relationship. The Chen's ERD notation is still used and is considered to present a more detailed way of representing entities and relationships. To create an ERD, software engineers mainly turn to dedicated drawing software, which contain the full notation resources for their specific database design - ERD symbols and meanings. CS Odessa has released an all-inclusive Entity-Relationship Diagram (ERD) solution for their powerful drawing program, ConceptDraw DIAGRAM. How to Build an Entity Relationship Diagram (ERD) UML Notation Unified Modeling Language (UML) is a language of graphic description for object modeling in the field of software engineering. UML was created for definition, visualization, designing of software systems. UML is an open standard that uses graphic notations for creating visual models of object-oriented software systems. Two types of diagrams are used in UML: Structure Diagrams and Behavior Diagrams. Behavior Diagrams represent the processes proceeding in a modeled environment. Structure Diagrams represent the elements that compose the system. Notation & Symbols for ERD The ER diagram is constructed from the specific ERD graphic elements. There are used 2 types of ERD notations: Chen and Crow's Foot. A complete set of work flow shapes, notation & symbols for ERD, entity relationship stencils, included in Entity-Relationship Diagram (ERD) solution for ConceptDraw DIAGRAM software, makes drawing diagrams based on ERD notation as smooth as possible. Entity Relationship Diagram - ERD - Software for Design Chen ER Diagrams The Entity-Relationship Diagram (ERD) solution from ConceptDraw Solution Park extends ConceptDraw DIAGRAM vector graphics and diagramming software with the ability to describe a database using the Entity-Relationship (Chen) model. Use it for design your ERDs and verify that ConceptDraw DIAGRAM offers the best ERD diagrams software tools for design element Chen notation. "Chen's notation for entityrelationship modeling uses rectangles to represent entity sets, and diamonds to represent relationships appropriate for first-class objects: they can have attributes and relationships of their own. If an entity set participates in a relationship set, they are connected with a line. Attributes are drawn as ovals and are connected with a line to exactly one entity or relationship set. Cardinality constraints are expressed as follows: - a double line indicates a participation constraint, totality or surjectivity: all entities in the entity set must participate in at least one relationship in the relationship set; - an arrow from entity set to relationship set indicates a key constraint, i.e. injectivity: each entity of the entity set can participate in at most one relationship in the relationship set; - a thick line indicates both, i.e. bijectivity: each entity in the entity set is involved in exactly one relationship. - an underlined name of an attribute indicates that it is a key: two different entities or relationships with this attribute always have different values for this attribute. Attributes are often omitted a

conceptdraw.com

Entity-relationship diagrams, also called ERDs or ER diagrams, are flowchart-like diagrams that explain the structure of entities, attributes, and their relationships in a database. They are mainly used for relational database design, and can be used to troubleshooting designs. There are many notations and symbols that are unique to ERDs that you need to know in order to read and create them.ER diagram notations and symbolsSimilar to other diagram shapes, in ER diagrams entities are represented with rectangles, attributes are represented by ovals or inside entities, and relationships are shown in diamonds or with lines. There are six notation types, some more common than others.Make your own ER diagram in Gleek.Arrow notationArrow notation is simple and easily recognizable. Its main focus is the number of relationships entities have within a system.Arrow notationArrow notation symbolsZero or one relationship a single-headed arrow, with an open circle on the line.One relationship A straight line with one arrowheadZero or many relationships Two arrowheads, one sitting just behind the other, and a straight lineOne or many relationships Two arrowheads, like above, with a short, perpendicular line.Barkers notationInvented by Richard Barker, this notation is most commonly used for describing data in Oracle. Barkers notations are widely used, and most people familiar with diagrams have seen these notations before.Barkers notation symbolsEntities are displayed as rectangles with rounded edges, attributes with one of three symbols inside the entity box, and relationships with various lines.Attributes can be shown in one of three ways:Unique identifier Shown with a pound sign, or hashtag (#)Mandatory This attribute is shown with an asterisk (*)Optional Represented by ORelationships are drawn to show both optionality and degree, so there each relationship line tells the reader two things.Optionality symbolsMandatory relationship A straight, solid lineOptional relationship A dashed lineBarkers notationRelationship degree symbolsOne to one One solid line, like with mandatory relationshipsOne to many On one end of the line, there are two branching lines, like a fork or a tridentMany to many Trident shapes are on both ends of the lineUID bar A perpendicular line, just behind the trident shape on a relationship lineChen notationPeter Chen, the creator of Chens notation, invented this more detailed way of notation in 1976. Chens notation was one of the first to be used in software design, and is still popular in ERD creation. Unlike Barkers notation and UML, entities, relationships, and attributes have many different ways of being represented.Chen notation symbolsLets start with entities. An entity is shown in a rectangle, just like in many other notations. But, that is where the similarities stop. There are 2 more ways to describe entities:Weak entity A rectangle within a rectangleAssociative entity A diamond within a rectangleAttributes are in ovals. Here are some other symbols used to define attributes:Key attribute The title of the attribute is underlinedPartial key attribute The attributes name is underlined with a dashed lineComposite attributes These attributes branch off from a larger attribute, and are a different colorMultivalued attribute An oval within an ovalComputed/derived attribute An oval with a dashed lineRelationships are defined with optionality, cardinality, degree, participation, and type; using lines and diamonds.TypeStrong relationship A solid-lined diamondWeak relationship A diamond within a diamond, like a weak entityOptionalityMandatory A solid lineOptional A dashed lineNote that these are the same as in Barkers notation.Cardinality (degree)One to one A 1 is at each end of the relationshipOne to many A 1 is at one end, and N is at the other. N represents many.Many to one Like one to many, but reversedMany to many M is on one end, and N is on the otherParticipationTotal participation Two p

gleek.io

UML and ERDs are both used by software developers to map out software systems and databases before any actual coding occurs. Making a diagram beforehand helps developers see what components are needed, and how the system or database will be structured.UML is a series of symbols and shapes that help to visualize how software systems are organized, and ERDs show the relationships of entities within databases. Both are able to be read by anyone with relative ease.What is UML?UML, short for Unified Modeling Language, is a set of agreed upon notations, shapes, and symbols that tell the reader what components exist within a software system, their attributes, and how they relate to each other. Planning a software system is a crucial step that cannot be skipped, much like how architects and construction workers cannot build a house without a blueprint. Anyone can learn to read and use UML, regardless of whether theyre in the software development field or not.Make your own UML diagram with Gleek.There are many types of UML diagrams, all with different functions, yet using very similar symbols. There are two types of UML diagrams: structural and behavioral. Here are a few of the most common UML diagram types.For more detailed information on UML diagrams, check out our article on UML diagram types.Common types of UML structural diagramsProfile diagram This diagram type extends the UML model using stereotypes, which allows for the creation of certain domains and platforms.Package diagram Package diagrams show components as bundles of information, which makes organization more manageable.Class diagram The most common UML diagram type, class diagrams show the associations between classes and interfaces.Source: Bank diagram exampleDeployment diagram Deployment diagrams are used to show real world entities, such as servers, and the deployment of nodes within the system.Object diagram These diagrams show objects and how they relate and interact with each other.Common types of UML behavioral diagramsSequence diagram Another of the most common UML diagram types, sequence diagrams show how objects interact, and in what order, over time.Online shopping system sequence diagramInterested in making sequence diagrams? Read our article about the top 8 UML sequence diagram tools.Activity diagram Similar to sequence diagrams, activity diagrams focus on how control shifts between objects when certain actions are performed.Use case diagram With use case diagrams, we can see the user and all the specific actions they can take when interacting with the system. The chart then shows how these actions activate and move through the system.Communication diagram Communication diagrams are similar to sequence diagrams, but instead focus on interactions within the whole system, rather than how long they take.Interaction overview diagram These are more detailed versions of activity diagrams, and show not only the flow of activities and control, but also allow for other inline actions to be added.What is an ERD?ERD is short for Entity Relationship Diagram, and they are used to plan and model databases before their creation. ER diagrams are an offshoot of the entity-relationship model, which shows how entities interact in a database.Check out what are the best Entity-relationship tools.ERD notationsThere are 6 notation types used to make ERDs that serve different functions for the reader. Here are a few of the most common ones.Check out our article on entity-relationship diagram notations to learn more about all 6 types.Chen notation This notation type is more detailed than others. Users can identify entities and relationships as weak or strong, and attributes can be classified in additional ways.Crows foot notation Crows notation is one of the more detailed notation styles. One difference is the presence of multiplicities, which tell the reader how many instances interact with other instances.Hospital management system ER diagram with Crows foot notationBa

gleek.io