Question

In: Computer Science

Write create table statements to create tables for the Exoproduct employees computers database depicted by the...

Write create table statements to create tables for the Exoproduct employees computers database depicted by the relational schema created in a mini case MC5 in chapter 3. Use insert into statements to insert no fewer than 2 and no more than 10 records per table.

Solutions

Expert Solution

In case of any queries,please comment. I would be very happy to assist all your queries.Please give a Thumps up if you like the answer.

The create table statements are

CREATE TABLE SOFTWARE_PACKAGE ( SPID VARCHAR(10), SPNAME VARCHAR(100) NOT NULL, CONSTRAINT SOFTWARE_PACKAGE_PK PRIMARY KEY (SPID));
CREATE TABLE COMPUTER ( COMPID VARCHAR(10), COMPMODEL VARCHAR(100), COMPMAKE VARCHAR(100),CONSTRAINT COMPUTER_PK PRIMARY KEY (COMPID));
CREATE TABLE EMPLOYEE (EMPID VARCHAR(10), EMPNAME VARCHAR(100) NOT NULL, COMPID VARCHAR(10) ,CONSTRAINT EMPLOYEE_PK PRIMARY KEY (EMPID),CONSTRAINT EMPLOYEE_FK FOREIGN KEY (COMPID) REFERENCES COMPUTER(COMPID));

CREATE TABLE EMPLOYEE_SKILL(EMPSKILL VARCHAR(100), EMPID VARCHAR(10) , CONSTRAINT EMP_SKILL_PK PRIMARY KEY (EMPSKILL,EMPID),CONSTRAINT EMPLOYEE_SKILL_FK FOREIGN KEY (EMPID) REFERENCES EMPLOYEE(EMPID));

CREATE TABLE INSTALLEDAT(SPID VARCHAR(10), COMPID VARCHAR(10) , CONSTRAINT INSTALLEDAT_PK PRIMARY KEY (COMPID, SPID), CONSTRAINT INSTALLEDAT_FK1 FOREIGN KEY (SPID) REFERENCES SOFTWARE_PACKAGE(SPID),CONSTRAINT INSTALLEDAT_FK2 FOREIGN KEY (COMPID) REFERENCES COMPUTER(COMPID));

CREATE TABLE CERTIFIEDTOUSE( EMPID VARCHAR(10) , SPID VARCHAR(10),CONSTRAINT CERTIFIEDTOUSE_PK PRIMARY KEY (EMPID, SPID), CONSTRAINT CERTIFIEDTOUSE_FK2 FOREIGN KEY (EMPID) REFERENCES EMPLOYEE(EMPID),CONSTRAINT CERTIFIEDTOUSE_FK1 FOREIGN KEY (SPID) REFERENCES SOFTWARE_PACKAGE(SPID));

The insert into statements are

#software package table
insert into SOFTWARE_PACKAGE values('1','QuickNumbers');
insert into SOFTWARE_PACKAGE values('2','Presenter');
insert into SOFTWARE_PACKAGE values('3','WordSmith');
insert into SOFTWARE_PACKAGE values('4','GraphixStudio');

#COMPUTER table
insert into COMPUTER values('100','X200','Zenovo',);
insert into COMPUTER values ('101','X200','Zenovo');
insert into COMPUTER values('102','Bartlett','Pear');
insert into COMPUTER values('103','SlimBook','TamTung');
insert into COMPUTER values('104','X500','Zenovo');


#employee table
insert into EMPLOYEE values('30','Jolly',100);
insert into EMPLOYEE values('31','James',101);
insert into EMPLOYEE values('32','Eric',102);
insert into EMPLOYEE values('33','Christiano',103);

#employee skills table
insert into EMPLOYEE_SKILL values('Back-End','30' );
insert into EMPLOYEE_SKILL values('Front-End','30' );
insert into EMPLOYEE_SKILL values('Back-End','31');
insert into EMPLOYEE_SKILL values('PC Maintenance','31');
insert into EMPLOYEE_SKILL values('Front-End','32');

#installedat table
insert into INSTALLEDAT values('1',101);
insert into INSTALLEDAT values('3',101);
insert into INSTALLEDAT values('2',102);
insert into INSTALLEDAT values('1',103);
insert into INSTALLEDAT values('3',104);

#certifiedtouse table
insert into CERTIFIEDTOUSE values('30','1');
insert into CERTIFIEDTOUSE values('30','3');
insert into CERTIFIEDTOUSE values('30','2');
insert into CERTIFIEDTOUSE values('31','1');
insert into CERTIFIEDTOUSE values('31','3');

The select statements are
#Display values
select * from SOFTWARE_PACKAGE;
select * from COMPUTER;
select * from EMPLOYEE;
select * from EMPLOYEE_SKILL;
select * from INSTALLEDAT;
select * from CERTIFIEDTOUSE;

Output


Related Solutions

Write CREATE TABLE and INSERT INTO statements in order to create and populate five tables in...
Write CREATE TABLE and INSERT INTO statements in order to create and populate five tables in Oracle’s SQL*Plus.The information you need about the database ARE IN THE CHARTS BELOW. Each worksheet includes the following information about its associated table: ➢ Column names (for example, the jr_order table contains the orderID, customerID, orderDate, orderStatus, and orderShippedDate columns); ➢ Column data types (for example, orderID is INT, orderStatus is VARCHAR2(2), etc.); ➢ Column constraints, if any (for example, orderID in the jr_order...
1. Write CREATE TABLE statements for the following tables (foreign keys are in italic and bold)....
1. Write CREATE TABLE statements for the following tables (foreign keys are in italic and bold). Make sure you have all needed constraints and appropriate datatypes for attributes: Student (stID, stName, dateOfBirth, advID, majorName, GPA) Advisor (advID, advName, specialty) 2.  Insert several records in each table.
1. write SQL statements to create the following two tables: a) Department table that contains the...
1. write SQL statements to create the following two tables: a) Department table that contains the following columns(dept_no,deptname,location) set the deptno to be the primary key. b) Employee table contains the following columns(emp_no,empname,deptno,salary)set the emp_no to be the primary key and dept_no to be the foreign key. 2. Write SQL statements to Insert the following 3 rows in Employee table:        (101,’Sami’,’D-101’,5000)        (102,’Yousef’,’D-101’,4000)        (103,’Sami’,’D-102’,7000) 3. Write SQL statements to Insert the following 3 rows in Department table:       ...
Tables: Create table Item(    &nbs... Bookmark Tables: Create table Item(                 ItemId           &nb
Tables: Create table Item(    &nbs... Bookmark Tables: Create table Item(                 ItemId                 char(5) constraint itmid_unique primary key,                 Decription           varchar2(30),                 Unitcost               number(7,2)); Create table Customer(                 custID                   char(5) constraint cid.unique primary key,                 custName          varchar2(20),                 address                                varchar2(50)); Create table Orderdata( orderID                char(5) constraint oid_uniq primary key,                 orderdate           date,                 shipdate              date,                 ItemId                  char(5) references Item.ItemId,                 No_of_items     number(4),                 Unitcost               number(7,2),                 Order_total        number(7,2),                 custID                   char(5) references customer.custID); Insert Into Item values(‘A123’,’Pencil’,2.5);...
Database exercise: inpatient cases Create database using name RUMKIT Create tables below in that database patient(idPatient,...
Database exercise: inpatient cases Create database using name RUMKIT Create tables below in that database patient(idPatient, fullName, biologicalMother, birthdate, address) doctor(idDr, fullName, specialization, consulRates) inpatient(idPatient, entryTime, outTime, idDr, idRoom). Please make entryTime as column that is going to be filled automatically when care record is being add room(idRoom, roomName, cost) fill the data above to each table Create sql query and relational algebra expressions for the query Please give me detailed answer so I could learn from it. Thank you...
Use MYSQL to create the set of database tables of the relational database model and complete...
Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given. Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys. 2) Execute each statement in the correct order to create the relational database in MYSQL. 3)Insert some data into each table. 4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench 5) Write...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The...
Create three MySQL database tables and write SQL scripts to read, insert, and delete data. The first database table will contain the names of at least four movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple...
Company X database Create an ER Diagram using UML notation for the following tables, then write...
Company X database Create an ER Diagram using UML notation for the following tables, then write out in the Relational model. Company X is a manufacturing company that binds and sells books. They have hired you to create database to track their Employees, Products, customers and their orders. All employees work with book Binding, Only some are designated as Reps for customers. Reps may have many customers. But each customer can only have 1 rep. They count to record each...
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT