Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Nomenclature convention for relations: Tablename(fieldname1, fieldname2, ...) primary key has a single underline just the foreign key - bold italics concatenated primary key - both

image text in transcribedimage text in transcribedimage text in transcribed

Nomenclature convention for relations: Tablename(fieldname1, fieldname2, ...) primary key has a single underline just the foreign key - bold italics concatenated primary key - both fields underlined (the comma and space are not underlined) Note: intersection tables will have foreign keys. They might have concatenated primary key - but they will not be shown as bold italics. ASSIGNMENT : Question 1 Create a script which will create the tables listed below. Please prefix table names with your email userID. For example, if your userID is pukhraj, pukhraj_tbIEMPLOYEE should be the table name. Make sure to use EXACT table/field names as in the assignment. Changing table/field names is not allowed, so you could get 0 points for the assignment!!! TbIEmployee(EMPLOYEEID, FNAME, LNAME, DEPTID, DATEOFBIRTH, TEL_NUMBER, JOBID) TbIDeparment(DEPTID, DEPARTMENT_NAME) TbIJob(JOBID, JOBTITLE, MIN_SALARY,MAX_SALARY) TbIProiect(PROJECTID. PROJECT NAME) TbIEmployee_Project(PROJECTID, EMPLOYEEID) Please note: in TbIEMPLOYEE_PROJECT(PROJECTID, EMPLOYEEID) table: You have one concatenated primary key (PROJECTID EMPLOYEEID) and two foreign keys: PROJECTID - primary key is PROJECTID in the TbIPROJECT table, and second foreign key: EMPLOYEEID_- primary key is EMPLOYEEID in the TbIEMPLOYEE table. Start the script with a series of DROP statements so that as you correct mistakes you will start fresh each time. To avoid referential integrity errors, the table drops should be in the opposite order of the create table statements. Put script name and your name in the script heading -see example: Example of a script for MySQL: /*script1.sql Student Name: -----*/ USE sh; DROP TABLE IF EXISTS part; DROP TABLE IF EXISTS salesrep; CREATE TABLE part (Partno CHAR(4) PRIMARY KEY, Partdesc VARCHAR(20), Onhand INTEGER, Partclass CHAR(2) check (Partclass IN ('AP','HW','KI','SP')), Unitprice DECIMAL(6,2) ); CREATE TABLE salesrep (Srepno CHAR(3), Srepname VARCHAR(25), Srepprov VARCHAR(3) NOT NULL, Sreppcode VARCHAR(6) NOT NULL, Totcomm DECIMAL(8,2), Commrate DECIMAL (3,2), CONSTRAINT pksIsrep PRIMARY KEY (Srepno) ); Test your script and if it is working. Submit in one sql file for grading. Question 2 Write SQL script to insert sample data to the tables you just created in question 1 of the assignment. Use your name for one of the employee record. Submit also sql script

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why must a conduit entity report certain deductions separately?

Answered: 1 week ago