Anda di halaman 1dari 6

COMPUTER STORE

Members:

Bonife Sabio

Marielle Salan

Ferdinand Llasos

Katharina Lauron

Jean Ann Sembria

Kaye Marie Daguplo

Esther Beiye Eduave

Vadeza Beann Villasi

Ma. Noechie Elegarle

Christine Jessa Botardo

April 15, 2018


DATA DEFINITION

CREATE DATABASE ComputerStore_db; CREATE TABLE Customers (


CustomerID int(9) NOT NULL,
FirstName varchar(30),
CREATE TABLE Employees ( LastName varchar(30),
EmployeeID int(9) NOT NULL, Address varchar (200),
FirstName varchar(30), EmployeeID int(9),
MiddleInitial varchar(3), PRIMARY KEY (CustomerID)
LastName varchar(30), );
DateEmployed date,
Birthday date, CREATE TABLE Orders (
Position varchar(20), OrderNumber int(9) NOT NULL AUTO_INC
Sex varchar(6), REMENT,
Barangay varchar(30), DatePlaced date,
MunicipalityOrCity varchar(30), CustomerID int(9),
BranchID int(9), PRIMARY KEY (OrderNumber)
PRIMARY KEY (EmployeeID) );
);

CREATE TABLE Details (


CREATE TABLE EmployeesTasks ( DetailID int(9) NOT NULL,
EmployeeID int(9) NOT NULL, SellingPrice int(20),
TaskID int(9) NOT NULL Quantity int(30),
); OrderNumber int(9),
ProductID int(9),
PRIMARY KEY (DetailID)
CREATE TABLE Tasks (
);
TaskID int(9) NOT NULL,
Name varchar(60),
CREATE TABLE Categories (
Description varchar(300),
CategoryID int(9) NOT NULL,
PRIMARY KEY (TaskID)
Name varchar(60),
);
PRIMARY KEY (CategoryID)
);
CREATE TABLE Branches (
BranchID int(9) NOT NULL,
Name varchar(60), CREATE TABLE Products (
ContactNumber int(20), ProductID int(9) NOT NULL,
Province varchar(30), Name varchar(60),
MunicipalityOrCity varchar (30), Price int(20),
PRIMARY KEY (BranchID) MainOfficeID int(9),
); CategoryID int(9),
PRIMARY KEY (ProductID)
);
CREATE TABLE MainOffices (
MainOfficeID int(9) NOT NULL,
Name varchar (60),
ContactNumber int(20),
Province varchar (60),
MunicipalityOrCity varchar(30),
PRIMARY KEY (MainOfficeID)
);
DATA MANIPULATION

INSERT INTO STATEMENTS

INSERT INTO Employees


VALUES ('000034613', 'Mary Daisy', 'T', 'Campo', '08/05/16', '10/18/94',
'Cashier', 'Female', 'Brgy. Poblacion', 'Valencia City', '001010088');

INSERT INTO Employees (EmployeeID, FirstName, MiddleInitial, LastName, Position)


VALUES ('000034573', 'Arman', 'V', 'Dairo', 'Salesman');

INSERT INTO Employees (EmployeeID, FirstName, LastName, DateEmployed, Birthday,


Position, Sex, MunicipalityOrCity, BranchID)
VALUES ('000071308', 'Ronel', 'Colis', '05/08/07', '02/26/84', 'Manager', 'Male',
'Valencia City', '001010088');

SELECT STATEMENTS

SELECT * FROM Employees


ORDER BY LastName ASC;

SELECT * FROM Employees


WHERE MunicipalityOrCity='Maramag' OR MunicipalityOrCity='Valencia City';

SELECT * FROM Employees


WHERE FirstName LIKE 'r%l';

UPDATE STATEMENTS

UPDATE Employees
SET Position='Assistant Manager'
WHERE EmployeeID=000034573;

UPDATE Employees
SET LastName='Ocampo', MunicipalityOrCity='Maramag'
WHERE EmployeeID=000034613;

UPDATE Employees
SET DateEmployed='06/20/16', Birthday='01/05/16', Sex='Male',
MunicipalityOrCity='Valencia City', BranchID=001010088
WHERE EmployeeID=000034573;
DELETE STATEMENTS

DELETE FROM Employees


WHERE Position='Cashier';

DELETE FROM Employees


WHERE EmployeeID=000034573;

DELETE FROM Employees


WHERE MunicipalityOrCity='Valencia City';