-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
316 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
sign | ||
connection.close() | ||
|
||
# User-related functions | ||
def write_to_users(data): | ||
connection = get_db_connection(db_config) | ||
if connection: | ||
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
CREATE DATABASE BrewandBrain_warehouse; | ||
-- Create the BrewandBrain_warehouse database if not exists | ||
CREATE DATABASE IF NOT EXISTS BrewandBrain_warehouse; | ||
|
||
-- Use the BrewandBrain_warehouse database | ||
USE BrewandBrain_warehouse; | ||
|
||
CREATE TABLE IF NOT EXISTS UserSummary( | ||
-- Drop the UserSummary table if it exists | ||
DROP TABLE IF EXISTS UserSummary; | ||
|
||
-- Create the UserSummary table | ||
CREATE TABLE UserSummary ( | ||
UserID INT NOT NULL, | ||
School VARCHAR (100), | ||
ReservationID INT NOT NULL, | ||
School VARCHAR(100), | ||
Occupation VARCHAR(100), | ||
StartTime DATETIME, | ||
EndTime DATETIME, | ||
StartTime VARCHAR(255) NOT NULL, | ||
EndTime VARCHAR(225) NOT NULL, | ||
Seat VARCHAR(50), | ||
Gender ENUM('Male', 'Female', 'Other'), | ||
PRIMARY KEY (UserID) | ||
); | ||
|
||
CREATE INDEX idx_UserSumamry_UserID ON UserSummary(UserID); | ||
-- Create an index on the UserID column | ||
CREATE INDEX idx_UserSummary_UserID ON UserSummary(UserID); | ||
|
||
INSERT INTO UserSummary (UserID, ReservationID, School, Occupation, StartTime, EndTime, Seat, Gender) | ||
VALUES | ||
(1, 101, 'University of the Philippines', 'Student', '2023-01-01 08:00:00', '2023-01-01 10:00:00', 'A1', 'Male'), | ||
(2, 102, 'Tech Institute', 'Engineer', '2023-01-02 09:00:00', '2023-01-02 12:00:00', 'B2', 'Female'), | ||
(3, 103, 'Business School', 'Entrepreneur', '2023-01-03 10:00:00', '2023-01-03 11:30:00', 'C3', 'Other'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.