Question

In: Computer Science

Using MySQL 8.xx create a database with the following characteristics. . A. Your design MUST meet...

Using MySQL 8.xx create a database with the following characteristics. .

A. Your design MUST meet the requirements for Third Normal Form

B. Create a database (you will need multiple tables) to store employee information. This information will include:

Employee Number, First Name, Last Name, Date of birth, Address, city, state, zip, department, job title, supervisor, health insurance number, health insurance provider, dental insurance number, dental insurance provider, spouse/partner, children, children's ages.

C. Populate the table with multiple records which will cover all possible relations.

Note: Determine which fields are required and which fields are optional. Determine the correct data types and sizes for each field. Include the 'relationships' between the tables. Hint: You will need some secondary key fields to link tables together.

What to turn in:

Screen shots (only)

1. Database table metadata showing table names, column names, data types and sizes.

2. Map of relations between tables (tables with arrows between them).

3. Contents of each table with related data.

Solutions

Expert Solution

1.

First we create employee table with number, first name, last name and date of birth. here the primary key is employee number.

SQL> create table emp(emp_no int NOT NULL,
F_name varchar(20) NOT NULL,
L_name varchar(20) NOT NULL,
Date_birth DATE NOT NULL,
primary key(emp_no) );

Then we create our 2nd table that is address which contains address, state, city, zip code of employee.

it also contains foreign key of emp_no to connect this table with employee table.

SQL> create table Address
( addr varchar(250) NOT NULL,
City varchar(50) NOT NULL,
State varchar(50) NOT NULL,
Zip CHAR(5) NOT NULL,
FOREIGN KEY(emp_no) REFERENCES emp(emp_no));

3rd table is department table which includes the supervisor of employee, department and job title.

SQL> create table department

( dept varchar(100) NOT NULL,

job_title varchar(100) NOT NULL,

supervisor varchar(100) NOT NULL,

FOREIGN KEY(emp_no) REFERENCES emp(emp_no));

Our 4th table is insurance table, where we include both insurance- dental and health for employee.

SQL> create table insurance

( health_insu_no char(10) NOT NULL,

health_insu_provider varchar(50) NOT NULL,

dental_insu_no char(10) NOT NULL,

dental_insu_provider varchar(50) NOT NULL,

FOREIGN KEY(emp_no) REFERENCES emp(emp_no));

5th table is Family table where we include details about family such as spouse/partner, children, children's age.

we connect this table with employee using foreign key.

SQL> create table family

( spouse_partner varchar(50) NOT NULL,

children int NOT NULL,

child_age int NOT NULL,

FOREIGN KEY(emp_no) REFERENCES emp(emp_no));

2.


Related Solutions

Using the sample.sql script, create the sample database in MySQL. Submit the MySQL interactive screen that...
Using the sample.sql script, create the sample database in MySQL. Submit the MySQL interactive screen that results. create database sample; use sample; create table customer (custno int auto_increment primary key, firstname varchar(20), middle varchar(20), lastname varchar(20), address varchar(60), telnum1 varchar(10), telnum2 varchar(10), telnum3 varchar(10), pin varchar(6), email varchar(30)); create table accttype (id int primary key, type varchar(10)); insert into accttype (id, type) values (1,'check'); insert into accttype (id, type) values (2,'save'); insert into accttype (id, type) values (3,'cd'); insert into...
Design and implement a relational database application of your choice using MS Workbench on MySQL a)...
Design and implement a relational database application of your choice using MS Workbench on MySQL a) Declare two relations (tables) using the SQL DDL. To each relation name, add the last 4 digits of your Student-ID. Each relation (table) should have at least 4 attributes. Insert data to both relations (tables); (15%) b) Based on your expected use of the database, choose some of the attributes of each relation as your primary keys (indexes). To each Primary Key name, add...
Design Of Database System Course True or False 1. In MySQL, it is possible to create...
Design Of Database System Course True or False 1. In MySQL, it is possible to create a table by using the definition of another table. 2. {(t.lname) | s ∈ Student, s.stuId = t.stuId, t ∉ Graduate_Student, s.major = ‘CS’} is a safe relational calculus expression. 3. In SQL, it is possible to insert multiple rows into a table using a single INSERT statement.
Using the world_x database you installed on your MySQL Workbench, create a new table named “independence”...
Using the world_x database you installed on your MySQL Workbench, create a new table named “independence” with the following attributes (columns): A field named “id” which has data type auto_increment, A field named “country_name” which has data type varchar(50), and A field named “independence_date” which has type “date.” After you create the table, run the following SQL command: INSERT INTO independence(country_name, independence_date) VALUE (‘United States’,’1776-07-04’) Submit a 1-page Microsoft Word document that shows the following: The SQL command you used...
In MySql, using Application MYSQL Workbench and the Chinook database, please answer the following: -- 12....
In MySql, using Application MYSQL Workbench and the Chinook database, please answer the following: -- 12. SELECT the trackid, name and filesize (as shown in the bytes column) for all tracks that have a file size less than 2000000 and a GenreId of 1 or a file size less than 2000000 and a Genreid of 2 -- 13. Add a sort to the query from number 12 to sort by GenreID; -- 14. List all columns from the customer table...
Using PHP and MYSQL and with a simple customer database, how can I create a simple...
Using PHP and MYSQL and with a simple customer database, how can I create a simple log in and registration system for an ecommerce site
Create a database and design an ER diagram for the given question. Must link the related...
Create a database and design an ER diagram for the given question. Must link the related tables then implement the design using MySQL. Insert at least 5 records. Ensure that the data to be added are related to other tables. Follow this format in creating the database and table: Database format: databasename_yourname Table format: tablename_yourname QUESTION: Company ABC has the following business rules. A department employs many employees, but each employee is employed by only one department. A division operates...
Using MYSQL in terminal, create the tables for your above designed relational schema and populate your...
Using MYSQL in terminal, create the tables for your above designed relational schema and populate your tables with appropriate data. All except time slot and the relationship it participates in. Use the names for the tables and attributes from the ER schema. Use ON DELETE CASCADE for foreign keys. Each basic table (corresponding to an entity in the ER schema developed for Part 1) should have 5-10 rows. Campus can have just 2. Building should have at least 6. At...
Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based...
Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based on your entities defining The attributes within each table The primary and foreign keys within each table *****Show your database tables, tables attributes, primary and foreign keys***** Do not forget to check the lesson slides and videos that show you how to convert an ER/EER into a database schema, and how to create a database and tables using MS SQL Server.
This refer to the “om” database (or Schema) that you will find in your MySQL Workbench...
This refer to the “om” database (or Schema) that you will find in your MySQL Workbench program if you have run the sample database install script. Please save all of your answers in one script (.sql) or type all your answers into Notepad++ and submit them as a single .sql file. Please test your SQL statements in Workbench 1.       Using an INNER JOIN, select the order_id, order_date, shipped_date, fname, and customer_phone from the orders and customers tables. The fname is a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT