Database sql lab | Computer Science homework help

load-project.sql

LOAD DATA LOCAL INFILE “project.dat”
INTO TABLE project
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

department.sql

DROP TABLE department;
CREATE TABLE department (
dname varchar(25) not null,
dnumber integer(4),
mgrssn char(9) not null,
mgrstartdate date,
primary key (dnumber),
key (dname)
);

worksOn.sql

DROP TABLE works_on;
CREATE TABLE works_on (
essn char(9),
pno integer(4),
hours decimal(4,1),
primary key (essn,pno),
foreign key (essn) references employee(ssn),
foreign key (pno) references project(pnumber)
);

project.sql

DROP TABLE project;
CREATE TABLE project (
pname varchar(25) not null,
pnumber integer(4),
plocation varchar(15),
dnum integer(4) not null,
primary key (pnumber),
unique (pname),
foreign key (dnum) references department(dnumber)
);

dept_locations.sql

DROP TABLE dept_locations;
CREATE TABLE dept_locations (
dnumber integer(4),
dlocation varchar(15),
primary key (dnumber,dlocation),
foreign key (dnumber) references department(dnumber)
);

source.sql

source department.sql
source employee.sql
source project.sql
source dept_locations.sql
source dependent.sql
source worksOn.sql
source load-department.sql
source load-employee.sql
source load-project.sql
source load-dloc.sql
source load-dependent.sql
source load-worksOn.sql

load-worksOn.sql

LOAD DATA LOCAL INFILE “worksOn.dat”
INTO TABLE works_on
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

README.html

There are three files for each table in this directory. For example for the
DEPARTMENT table the three files are:

<ol>
<li> department.sql: contains the SQL Create Table statement to create the table.
<li> department.dat: contains data for the table to be loaded using the MySQL load command.
<li> load-department.sql: contains the LOAD command to load data into the table.
</ol>

<P>
The file, source.sql, contains MySQL “source” commands to execute the “create table” and
“load” commands for each table.

<P>
After signing in to MySQL and changing to “company” database, simply run the following
command to create and populate the tables:

<P>
mysql> source source.sql

load-dloc.sql

LOAD DATA LOCAL INFILE “dloc.dat”
INTO TABLE dept_locations
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

ThislabinstructonsonhowtodesignEERdiagram_CreateDDLstatements_LoadDDLandpublishqueries.docx

This lab focuses on the design, build, and use of a relational database. Use MySQL and complete the following:
This is not an essay.

Complete an EER diagram of the company database described in chapter 4. You may use Visio, PowerPoint, MySQL Workbench, or gliffy.com Review Chapter 4 of the
Fundamentals of Database Systems 7E book on how to create an EER diagram.

1.
Create a database based on your design and provide the Create Table Statements. Write the Create table statements (even if you create the tables in MS Access, you need to provide the Create Table statements).
Keep in mind keys and referential integrity requirements

2. Use the Company SQL data files provided and load the database into MySQL and provide the output for following querries. Please review
Database Example file and the attach SQL and DAT files for reference.

· Prepare the following queries:

1.
Select * from each table

2.
Complete a query with at least 2 joins

3.
Complete a query with 2 joins and the use of an aggregate function like average or sum

4.
Complete a query using an outer join

3. You should submit your
EER diagram,
DDL statements,
Load DDL, and
queries in a single document.

load-dependent.sql

LOAD DATA LOCAL INFILE “dependent.dat”
INTO TABLE dependent
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

load-department.sql

LOAD DATA LOCAL INFILE “department.dat”
INTO TABLE department
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

load-employee.sql

LOAD DATA LOCAL INFILE “employee.dat”
INTO TABLE employee
FIELDS ENCLOSED BY “”” TERMINATED BY “,”
;

dependent.sql

DROP TABLE dependent;
CREATE TABLE dependent (
essn char(9),
dependent_name varchar(15),
sex char,
bdate date,
relationship varchar(8),
primary key (essn,dependent_name),
foreign key (essn) references employee(ssn)
);

employee.sql

DROP TABLE employee;
CREATE TABLE employee (
fname varchar(15) not null,
minit varchar(1),
lname varchar(15) not null,
ssn char(9),
bdate date,
address varchar(50),
sex char,
salary decimal(10,2),
superssn char(9),
dno integer(4),
primary key (ssn),
foreign key (superssn) references employee(ssn),
foreign key (dno) references department(dnumber)
);

FundamentalsofDatabaseSystems7E.pdf

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more