0% found this document useful (0 votes)
41 views3 pages

Alexamara

The document describes the creation of several database tables - MARINA, OWNER, MARINA_SLIP, SERVICE_CATEGORY, and SERVICE_REQUEST - to store and relate information about marinas, owners, boat slips, service categories, and service requests. Sample data is inserted into each table. Foreign keys are used to link the MARINA_SLIP and SERVICE_REQUEST tables to the MARINA and OWNER tables, and SERVICE_REQUEST to MARINA_SLIP and SERVICE_CATEGORY tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views3 pages

Alexamara

The document describes the creation of several database tables - MARINA, OWNER, MARINA_SLIP, SERVICE_CATEGORY, and SERVICE_REQUEST - to store and relate information about marinas, owners, boat slips, service categories, and service requests. Sample data is inserted into each table. Foreign keys are used to link the MARINA_SLIP and SERVICE_REQUEST tables to the MARINA and OWNER tables, and SERVICE_REQUEST to MARINA_SLIP and SERVICE_CATEGORY tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

sqlite ALEXAMARA.

db

.headers on
.mode column
.tables
.schema

CREATE TABLE MARINA


(
MARINA_NUM INTEGER PRIMARY KEY AUTOINCREMENT,
NAME VARCHAR(50) NOT NULL,
ADDRESS VARCHAR(30) NOT NULL,
CITY VARCHAR(30) NOT NULL,
STATE CHAR(2) NOT NULL,
ZIP CHAR(5) NOT NULL
);
PRAGMA TABLE_INFO('MARINA');

INSERT INTO MARINA VALUES (1, "Alexamara East", '108 2nd Ave.', 'Brinman', 'FL',
32273);
INSERT INTO MARINA VALUES (2, "Alexamara Central", '283 Branston', 'W. Brinman',
'FL', 32274);

SELECT * FROM MARINA;

CREATE TABLE OWNER


(
OWNER_NUM CHAR(4) PRIMARY KEY,
LAST_NAME VARCHAR(50) NOT NULL,
FIRST_NAME VARCHAR(50) NOT NULL,
ADDRESS VARCHAR(50) NOT NULL,
CITY VARCHAR(30) NOT NULL,
STATE CHAR(2) NOT NULL,
ZIP CHAR(5) NOT NULL
);
PRAGMA TABLE_INFO('OWNER');

INSERT INTO OWNER VALUES ('AD57', "Adney", "Bruce and Jean", '208 Citrus',
'Bowton', 'FL', 31313);
INSERT INTO OWNER VALUES ('AN75', "Anderson", "Bill", '18 Wilcox','Glander Bay',
'FL', 31044);
INSERT INTO OWNER VALUES ('BL72', "Blake", "Mary", '2672 Commodore', 'Bowton',
'FL', 31313);
INSERT INTO OWNER VALUES ('EL25', "Elend", "Sandy and Bill", '462 Riverside',
'Rivard', 'FL', 31062);
INSERT INTO OWNER VALUES ('FE82', "Feenstra", "Daniel", '7822 Coventry', 'Kaleva',
'FL', 32521);
INSERT INTO OWNER VALUES ('JU92', "Juarez", "Maria", '8922 Oak', 'Rivard', 'FL',
31062);
INSERT INTO OWNER VALUES ('KE22', "Kelly", "Alyssa", '5271 Waters", 'Bowton', 'FL',
31313);
INSERT INTO OWNER VALUES ('NO27', "Norton", "Peter", '2811 Lakewood', 'Lewiston',
'FL', 32765);
INSERT INTO OWNER VALUES ('SM72', "Smeltz", "Becky and Dave", '922 Garland',
'Glander Bay', 'FL', 31044);
INSERT INTO OWNER VALUES ('TR72', "Trent", "Ashton", '922 Crest', 'Bay Shores'
'FL', 30922);

SELECT * FROM OWNER;


CREATE TABLE MARINA_SLIP
(
SLIP_ID INTEGER PRIMARY KEY AUTOINCREMENT,
MARINA_NUM INTEGER,
SLIP_NUM INTEGER NOT NULL,
LENGTH INTEGER NOT NULL,
RENTAL_FEE DECIMAL(15,2) DEFAULT 0.00 NOT NULL,
BOAT_NAME VARCHAR(30) NOT NULL,
BOAT_TYPE VARCHAR(50) NOT NULL,
OWNER_NUM CHAR,
FOREIGN KEY (MARINA_NUM) REFERENCES MARINA(MARINA_NUM),
FOREIGN KEY (OWNER_NUM) REFERENCES OWNER(OWNER_NUM)
);
PRAGMA TABLE_INFO('MARINA_SLIP');

INSERT INTO MARINA_SLIP VALUES (1, 1, 'A1', 40, 3800, "Anderson II", 'Sprite 4000',
'AN75');
INSERT INTO MARINA_SLIP VALUES (2, 1, 'A2', 40, 3800, "Our Toy", 'Ray 4025',
'EL25');
INSERT INTO MARINA_SLIP VALUES (3, 1, 'A3', 40, 3600, "Escape", 'Sprite 4000',
'KE22');
INSERT INTO MARINA_SLIP VALUES (4, 1, 'B1', 30, 2400, "Gypsy", 'Dolphin 28',
'JU92');
INSERT INTO MARINA_SLIP VALUES (5, 1, 'B2', 30, 2600, "Anderson III", 'Sprite
3000', 'AN75');
INSERT INTO MARINA_SLIP VALUES (6, 2, 1, 25, 1800, "Bravo", 'Dolphin 25', 'AD57');
INSERT INTO MARINA_SLIP VALUES (7, 2, 2, 25, 1800, "Chinook", 'Dolphin 22',
'FE28');
INSERT INTO MARINA_SLIP VALUES (8, 2, 3, 25, 2000, "Listy", 'Dolpin 25', 'SM72');
INSERT INTO MARINA_SLIP VALUES (9, 2, 4, 30, 2500, "Mermaid", 'Dolphin 28',
'BL72');
INSERT INTO MARINA_SLIP VALUES (10, 2, 5, 40, 4200, "Axxon II", 'Dolphin 40',
'NO27');
INSERT INTO MARINA_SLIP VALUES (11, 2, 6, 40, 4200, "Karvel", 'Ray 4025', 'TR72');

SELECT * FROM MARINA_SLIP;

CREATE TABLE SERVICE_CATEGORY


(
CATEGORY_NUM INTEGER PRIMARY KEY AUTOINCREMENT,
CATEGORY_DESCRIPTION VARCHAR (50) NOT NULL UNIQUE
);
PRAGMA TABLE_INFO('SERVICE_CATEGORY');

INSERT INTO SERVICE_CATEGORY VALUES (1, 'Routine engine maintenance');


INSERT INTO SERVICE_CATEGORY VALUES (2, 'Engine repair');
INSERT INTO SERVICE_CATEGORY VALUES (3, 'Air conditioning');
INSERT INTO SERVICE_CATEGORY VALUES (4, 'Electrical systems');
INSERT INTO SERVICE_CATEGORY VALUES (5, 'Fiberglass repair');
INSERT INTO SERVICE_CATEGORY VALUES (6, 'Canvas installation');
INSERT INTO SERVICE_CATEGORY VALUES (7, 'Canvas repair');
INSERT INTO SERVICE_CATEGORY VALUES (8, 'Electronic
systems(radar,GPS,autopilots,etc.));

SELECT * FROM SERVICE_CATEGORY;

CREATE TABLE SERVICE_REQUEST


(
SERVICE_ID INTEGER PRIMARY KEY AUTOINCREMENT,
SLIP_ID INTEGER,
CATEGORY_NUM INTEGER,
DESCRIPTION VARCHAR(50) NOT NULL UNIQUE,
STATUS VARCHAR(50) NOT NULL UNIQUE,
EST_HOURS INTEGER NOT NULL,
SPENT_HOURS INTEGER NOT NULL,
NEXT_SERVICE_DATE DATE
);
PRAGMA TABLE_INFO('SERVICE_REQUEST');

INSERT INTO SERVICE_REQUEST VALUES (1, 1, 3, 'Air conditioner periodically stops


with code indicating low coolant level. Diagnose and repair.', 'Technician has
verified the problem. Air conditioning specialist has been called.', 4, 2,
12072013);
INSERT INTO SERVICE_REQUEST VALUES (2, 5, 4, 'Fuse on port motor blown on two
occasions. Diagnose and repair.', 'Open', 2, 0, 12072013);
INSERT INTO SERVICE_REQUEST VALUES (3, 4, 1, 'Oil change and general routine
maintenance (check fluids level)', 'Service call has been scheduled', 1, 0,
16072013);
INSERT INTO SERVICE_REQUEST VALUES (4, 1, 2, 'Engine oil level has been dropping
drastically. Diagnose and repair.', 'Open', 2, 0, 13072013);
INSERT INTO SERVICE_REQUEST VALUES (5, 3, 5, 'Open pockets at base of two
stantions', 'Technician has completed the initial filling of the open pockets. Will
complete the job after the initial fill has had sufficient time to dry, 4, 2,
13072013);
INSERT INTO SERVICE_REQUEST VALUES (6, 11, 4, 'Electric-flush system periodically
stops functioning. Diagnose and repair.', 'Open', 3, 0);
INSERT INTO SERVICE_REQUEST VALUES (7, 6, 2, 'Engine overheating. Loss of coolant.
Diagnose and repair.', 'Open', 2, 0, 13072013);
INSERT INTO SERVICE_REQUEST VALUES (8, 6, 2, 'Heat exchanger not operating
correctly.', 'Technician has determined that the exchanger has been ordered', 4, 1,
17072013);
INSERT INTO SERVICE_REQUEST VALUES (9, 7, 6, 'Canvas severely damaged in windstorm.
Order and install new.', 'Open', 8, 0, 16072013);
INSERT INTO SERVICE_REQUEST VALUES (10, 2, 8, 'Install new GPS and chart plotter.',
'Scheduled', 7, 0, 17072013);
INSERT INTO SERVICE_REQUEST VALUES (11, 2, 3, 'Air conditioning units shuts down
with HHH sowing on the control panel', 'Technician able to replicate the problem.
Air conditioning unit ran fine through multiple tests. Owner to notify technician
if the problem is not solved.', 1, 1);
INSERT INTO SERVICE_REQUEST VALUES (12, 4, 8, 'Both speed and depth readings on
data unit are significantly less than the owner thinks they should be.',
'Technician has scheduled appoitment with the owner to attempt to verify the
problem.', 2, 0, 16072013);
INSERT INTO SERVICE_REQUEST VALUES (13, 8, 2, 'Customer describes engine as making
a clattering sound.', 'Technician suspects problem with either propeller or shaft
and has scheduled the boat to be pulled from the water for further investigation.',
5, 2, 12072013);
INSERT INTO SERVICE_REQUEST VALUES (14, 7, 5, 'Owner accident caused damaged to
forward portion of port side.', 'Technician has scheduled repair.', 6, 0,
13072013);
INSERT INTO SERVICE_REQUEST VALUES (15, 11, 7, 'Canvas leaks around zippers in
heavy rain. Install overlap around zippers to prevent leaks.', 'Overlap has been
scheduled.', 8, 3, 17072013);

SELECT * FROM SERVICE_REQUEST;

You might also like