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...
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...
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);...
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...
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.
Create tables according to the mapping. Add 2 records to each. Create 5 queries for database...
Create tables according to the mapping. Add 2 records to each. Create 5 queries for database of 3 table joins to use most of the tables or group of tables in database. You should not have tables that are of no use. Student(ssn, name, major) Class(classID, name, f_ssn) Faculty(ssn, name, office_num, dept_id) Department(Dept_id, office_num, f_ssn) Enroll(s_ssn, classID, grade) Professor(f_ssn, alma-mater, tenured) Instructor(f_ssn, term_degree, type) Lecture(classID, method) Lab(classID, location) Person(ssn, dob, gender)
DROP DATABASE class;CREATE DATABASE class;Use class;drop table if exists Class;drop table if exists Student;CREATE TABLE Class...
DROP DATABASE class;CREATE DATABASE class;Use class;drop table if exists Class;drop table if exists Student;CREATE TABLE Class (CIN int PRIMARY KEY, FirstName varchar(255), LastName varchar(255), Gender varchar(1), EyeColor varchar(50), HairColor varchar(50), HeightInches int,CurrentGrade varchar(1));CREATE TABLE Student (SSN int PRIMARY KEY,FirstName varchar(255),LastName varchar(255), Age int,BirthMonth varchar(255),HeightInches int,Address varchar(255),City varchar(255),PhoneNumber varchar(12),Email varchar(255),FavColor varchar(255),FavNumber int);INSERT INTO Class VALUES(1, "David", "San", "M", "BRN", "BLK", 72, "-");INSERT INTO Class VALUES(2, "Jeff", "Gonzales", "M", "BRN", "BLK", 68, "B");INSERT INTO Class VALUES(3, "Anna", "Grayson", "F", "BRN", "BRN", 62,...
1. Write the statements to create a table named REQUIREMENTS. The table has the following columns:...
1. Write the statements to create a table named REQUIREMENTS. The table has the following columns: credits number (primary key) and degree name. 2. Write the statements to create a table named CANDIDATE with the following columns names. Pick the best column type: student_id, first name, last name, credits and graduation date. The credits column is a foreign key to the credits column in the REQUIREMENTS table. 3. Write the statement(s) to Insert 2 rows in your REQUIREMENTS table. Make...
Information on the following Database: create database Sales_Co use Sales_Co create table Vendor (v_code integer, v_name...
Information on the following Database: create database Sales_Co use Sales_Co create table Vendor (v_code integer, v_name varchar(35) not null, v_contact varchar(15) not null, v_areacode char(3) not null, v_phone char(8) not null, v_state char(2) not null, v_order char(1) not null, primary key (v_code)); create table product (p_code varchar(10) constraint product_p_code_pk primary key, p_descript varchar(35) not null, p_indate datetime not null, p_qoh integer not null, p_min integer not null, p_price numeric (8,2) not null, p_discount numeric (4,2) not null, v_code integer, constraint...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT