Update Sync

This commit is contained in:
LeviM0323 committed 2026-10-19 14:31:10 -04:00
commit 4777571334
30 files changed
+9627

No files matched your search

+144
View File
@@ -0,0 +1,144 @@
-- (1) Categories ---
-- DROP TABLE Categories CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE categories (
categoryId NUMBER(8,0),
categoryName VARCHAR2(15) NOT NULL,
categoryCode NUMBER(6,0),
description VARCHAR2(300),
CONSTRAINT Categories_CategoryID_pk PRIMARY KEY (CategoryId),
);
-- (2) Customers --
-- DROP TABLE Customers CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE customers (
customerId CHAR(5),
companyName VARCHAR2(40) NOT NULL,
contactName VARCHAR2(30),
contactTitle VARCHAR2(30),
address VARCHAR2(60),
city VARCHAR2(15),
region VARCHAR2(15),
postalCode VARCHAR2(10),
country VARCHAR2(15),
phone VARCHAR2(24),
fax VARCHAR2(24),
email VARCHAR2(50),
CONSTRAINT Customers_CustomerId_pk PRIMARY KEY (customerId)
);
-- (3) Employees --
-- DROP TABLE Employees CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE employees (
employeeId NUMBER(8,0),
lastName VARCHAR2(20) NOT NULL,
firstName VARCHAR2(10) NOT NULL,
title VARCHAR2(30),
titleOfCourtesy VARCHAR2(25),
birthDate DATE,
hireDate DATE,
address VARCHAR2(60),
city VARCHAR2(15),
region VARCHAR2(15),
postalCode VARCHAR2(10),
country VARCHAR2(15),
homePhone VARCHAR2(24),
extension VARCHAR2(4),
notes VARCHAR2(600),
reportsTo NUMBER(8,0),
photograph VARCHAR2(255),
SIN CHAR(9),
CONSTRAINT Employees_EmployeeId_pk PRIMARY KEY (employeeId),
);
-- (4) OrderDetails --
-- DROP TABLE OrderDetails CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE orderDetails (
orderId NUMBER(8,0) NOT NULL,
productId NUMBER(8,0) NOT NULL,
unitPrice NUMBER(8,2) NOT NULL,
quantity NUMBER(6,0) NOT NULL,
discount NUMBER(5,2) NOT NULL,
CONSTRAINT orderDetails_OID_PID_pk PRIMARY KEY (orderId, productId),
);
-- (5) Orders --
-- DROP TABLE Orders CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE orders (
orderId NUMBER(8,0) NOT NULL,
customerId CHAR(5),
employeeId NUMBER(8,0),
territoryId VARCHAR2(20),
orderDate DATE,
requiredDate DATE,
shippedDate DATE,
shipVia NUMBER(8,0),
freight NUMBER(8,2),
shipName VARCHAR2(40),
shipAddress VARCHAR2(60),
shipCity VARCHAR2(15),
shipRegion VARCHAR2(15),
shipPostalCode VARCHAR2(10),
shipCountry VARCHAR2(15),
CONSTRAINT Orders_OrderId_pk PRIMARY KEY (orderId),
);
-- (6) Products --
-- DROP TABLE Products CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE products (
productId NUMBER(8,0) NOT NULL,
productName VARCHAR2(40) NOT NULL,
supplierId NUMBER(8,0),
categoryId NUMBER(8,0),
quantityPerUnit VARCHAR2(20),
unitPrice NUMBER(8,2),
unitsInStock NUMBER(6,0),
unitsOnOrder NUMBER(6,0),
reorderLevel NUMBER(6,0),
discontinued NUMBER(1,0) NOT NULL,
CONSTRAINT Products_ProductID_pk PRIMARY KEY (productId)
);
-- (7) Suppliers --
-- DROP TABLE Suppliers CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE suppliers (
supplierId NUMBER(8,0) NOT NULL,
companyName VARCHAR2(40) NOT NULL,
contactName VARCHAR2(30),
contactTitle VARCHAR2(30),
address VARCHAR2(60),
city VARCHAR2(15),
region VARCHAR2(15),
postalCode VARCHAR2(10),
country VARCHAR2(15),
phone VARCHAR2(24),
fax VARCHAR2(24),
homepage VARCHAR2(200),
CONSTRAINT Suppliers_SupplierId_pk PRIMARY KEY (supplierId),
);
-- (8) Shippers --
-- DROP TABLE Shippers CASCADE CONSTRAINTS; -- uncomment after 1st run
CREATE TABLE shippers (
shipperId NUMBER(8,0) NOT NULL,
companyName VARCHAR2(40) NOT NULL,
phone VARCHAR2(24),
CONSTRAINT Shippers_Shipper_ID_pk PRIMARY KEY (shipperId),
);
SELECT table_name, 'Levi McLean' FROM user_tables
WHERE table_name != 'HTMLDB_PLAN_TABLE';
@@ -0,0 +1,51 @@
DROP TABLE test_customers;
CREATE TABLE test_customers (
CustomerID NUMBER(8),
CustName VARCHAR2(35) NOT NULL,
CustAge NUMBER(2),
CONSTRAINT pk_test_customers_CustomerID PRIMARY KEY(CustomerID),
CONSTRAINT uk_test_customers_CustName UNIQUE(CustName),
CONSTRAINT ck_test_customers_CustAge CHECK(CustAge>=16 AND CustAge<=70)
);
INSERT INTO test_customers VALUES(100, 'John Smith', null);
INSERT INTO test_customers VALUES(350, 'Mark Smith', 20);
SELECT * FROM test_customers;
CREATE TABLE test_orders (
OrderID NUMBER(8),
CustomerID NUMBER(8),
OrderDate Date,
OrderAmount NUMBER(8,2),
CONSTRAINT pk_test_orders_OrderID PRIMARY KEY(OrderID),
CONSTRAINT fk_test_orders_test_customers FOREIGN KEY(CustomerID) REFERENCES test_customers(CustomerID)
);
INSERT INTO test_orders VALUES(1, 100, '2023-01-15', 125.3);
INSERT INTO test_orders VALUES(2, 100, '2023-01-18', 300.3);
SELECT * FROM test_orders;
SELECT * FROM test_customers c JOIN test_orders o ON c.CustomerID = o.CustomerID;
SELECT constraint_name, constraint_type, search_condition, table_name, 'Levi McLean' AS "Created By"
FROM user_constraints
WHERE table_name IN('CATEGORIES','EMPLOYEES','CUSTOMERS', 'ORDERS','ORDER_DETAILS','PRODUCTS','VENDORS','PRODUCT_VENDORS')
AND constraint_name NOT LIKE 'SYS%'
ORDER BY 1;
SELECT 'Customers' AS "Levi McLean's Tables", COUNT(*) AS "Row Count" FROM CUSTOMERS
UNION
SELECT 'Employees', COUNT(*) FROM Employees UNION
SELECT 'Orders', COUNT(*) FROM Orders UNION
SELECT 'Orders Details', COUNT(*) FROM OrderDetails UNION
SELECT 'Products', COUNT(*) FROM Products UNION
SELECT 'Categories', COUNT(*) FROM Categories UNION
SELECT 'Shippers', COUNT(*) FROM Shippers UNION
SELECT 'Suppliers', COUNT(*) FROM Suppliers;
@@ -0,0 +1,48 @@
CREATE TABLE test_customer (
Id NUMBER(6,0),
Name VARCHAR2(20)
);
INSERT INTO test_Customer (Id, Name) VALUES (100,'SMITH');
INSERT INTO test_Customer (Id, Name) VALUES (101,'JONES');
INSERT INTO test_Customer (Id, Name) VALUES (100,'BROWN');
SELECT * FROM test_customer;
--TRUNCATE TABLE test_customer;
DROP TABLE test_customer;
CREATE TABLE test_customer (
Id NUMBER(6,0) PRIMARY KEY,
Name VARCHAR2(20)
);
DROP TABLE IF EXISTS test_customer;
CREATE TABLE test_customer (
Id NUMBER(6,0),
Name VARCHAR2(20),
CONSTRAINT test_customer_Id_pk PRIMARY KEY (Id)
);
-- Viewing the Data Dictionary
SELECT table_name, num_rows FROM USER_TABLES WHERE table_name != 'HTMLDB_PLAN_TABLE';
-- Table Creation through Sub Queries
CREATE TABLE cust_marketing AS
(SELECT Id, Lastname, FirstName, City, Province FROM Customers);
SELECT * FROM cust_marketing;
-- Modify Existing Tables
ALTER TABLE Vendors ADD Ext NUMBER(4,0);
ALTER TABLE VENDORS MODIFY Ext NUMBER(5,0);
ALTER TABLE vendors DROP COLUMN Ext;
SELECT table_name, num_rows FROM user_tables
WHERE table_name != 'HTMLDB_PLAN_TABLE';
Submodule INFO-3170 Javascript 3/Labs/Lab 2/LibraryApp added at a8ca2291d3.
Binary file not shown.
Submodule INFO-3172 Leveraging the Cloud/Projects/Group Project 1/website added at d8d2d85512.
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

@@ -0,0 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
# dependencies
node_modules/
# Expo
.expo/
dist/
web-build/
expo-env.d.ts
# Native
.kotlin/
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
# Metro
.metro-health-check*
# debug
npm-debug.*
yarn-debug.*
yarn-error.*
# macOS
.DS_Store
*.pem
# local env files
.env*.local
# typescript
*.tsbuildinfo
# generated native folders
/ios
/android
@@ -0,0 +1,21 @@
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import MainScreen from './screens/MainScreen';
import SendEmail from './screens/SendEmail';
import SendSMS from './screens/SendSMS';
const Stack = createNativeStackNavigator();
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="MainScreen">
<Stack.Screen name="MainScreen" component={MainScreen} options={{ title: 'Lab 4 - Send My Info App' }} />
<Stack.Screen name="SendEmail" component={SendEmail} />
<Stack.Screen name="SendSMS" component={SendSMS} />
</Stack.Navigator>
</NavigationContainer>
);
}
@@ -0,0 +1,11 @@
# Sample Snack app
Open the `App.js` file to start writing some code. You can preview the changes directly on your phone or tablet by scanning the **QR code** or use the iOS or Android emulators. When you're done, click **Save** and share the link!
When you're ready to see everything that Expo provides (or if you want to use your own editor) you can **Download** your project and use it with [expo cli](https://docs.expo.dev/get-started/installation/#expo-cli)).
All projects created in Snack are publicly available, so you can easily share the link to this project via link, or embed it on a web page with the `<>` button.
If you're having problems, you can tweet to us [@expo](https://twitter.com/expo) or ask in our [forums](https://forums.expo.dev/c/expo-dev-tools/61) or [Discord](https://chat.expo.dev/).
Snack is Open Source. You can find the code on the [GitHub repo](https://github.com/expo/snack).
@@ -0,0 +1,29 @@
{
"expo": {
"name": "lab-4-info-app",
"slug": "snack-afcff946-e184-4514-b19c-dfa890a17f09",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"edgeToEdgeEnabled": true
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@@ -0,0 +1,31 @@
import { Text, View, StyleSheet, Image } from 'react-native';
export default function AssetExample() {
return (
<View style={styles.container}>
<Text style={styles.paragraph}>
Local files and assets can be imported by dragging and dropping them into the editor
</Text>
<Image style={styles.logo} source={require('../assets/snack-icon.png')} />
</View>
);
}
const styles = StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
padding: 24,
},
paragraph: {
margin: 24,
marginTop: 0,
fontSize: 14,
fontWeight: 'bold',
textAlign: 'center',
},
logo: {
height: 128,
width: 128,
}
});
@@ -0,0 +1,8 @@
import { registerRootComponent } from 'expo';
import App from './App';
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,19 @@
{
"license": "0BSD",
"main": "index.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~54.0.37",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-native": "0.81.5",
"@expo/vector-icons": "^15.0.3",
"react-native-paper": "4.9.2"
},
"private": true
}
@@ -0,0 +1,51 @@
import React from 'react';
import { View, Text, Button, StyleSheet } from 'react-native';
import { useNavigation } from '@react-navigation/native';
const MainScreen = () => {
const navigation = useNavigation();
const navigateToSendEmail = () => {
navigation.navigate('SendEmail');
}
const navigateToSendSMS = () => {
navigation.navigate('SendSMS');
}
return (
<View style={styles.container}>
<Text style={styles.title}>SEND MY INFO</Text>
<Text style={styles.title}>l_mclean215318</Text>
<View style={styles.buttonContainer}>
<Button title="EMAIL MY INFO" color="green" onPress={navigateToSendEmail} />
</View>
<View style={styles.buttonContainer}>
<Button title="SMS MY INFO" color="blue" onPress={navigateToSendSMS} />
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
marginTop: 1,
justifyContent: 'center',
alignItems: 'center',
},
title: {
fontSize: 30,
fontWeight: 'bold',
marginBottom: 20,
alignItems: 'center',
},
buttonContainer: {
borderRadius: 10,
marginTop: 10,
padding: 10,
width: 200,
alignItems: 'center',
},
});
export default MainScreen;
@@ -0,0 +1,60 @@
import React from 'react';
import { View, Text, StyleSheet, Button, Alert } from 'react-native';
import * as MailComposer from 'expo-mail-composer';
const SendEmail = () => {
const [message, setMessage] = React.useState('Levi McLean\n123 Main St\nLondon, ON\n(555) 555-5555\naidanmclean111@gmail.com');
const sendMessageWithEmail = async () => {
try {
const isAvailable = await MailComposer.isAvailableAsync();
if (!isAvailable) {
Alert.alert('Email is not available on this device');
return;
}
const result = await MailComposer.composeAsync({
recipients: ['aidanmclean111@gmail.com'],
subject: 'Lab 4 - Customized Email',
body: message,
});
if (result.status === 'sent') {
Alert.alert('Email sent successfully');
} else {
Alert.alert('Failed to send email');
}
} catch (error) {
Alert.alert('Error sending email', error.message);
}
};
return (
<View style={styles.form}>
<Text style={styles.label}>You are going to send the following info:</Text>
<Text style={styles.messageInfo}>{message}</Text>
<Button title="Send via Email" onPress={sendMessageWithEmail} />
</View>
);
};
const styles = StyleSheet.create({
form: {
padding: 30,
marginTop: 60,
},
label: {
fontSize: 18,
marginBottom: 30,
textAlign: 'center',
},
messageInfo: {
fontSize: 16,
marginBottom: 15,
textAlign: 'center',
fontWeight: 'bold',
},
});
export default SendEmail;
@@ -0,0 +1,64 @@
import React, { useState } from 'react';
import { View, Text, StyleSheet, Button } from 'react-native';
import * as SMS from 'expo-sms';
const SendSMS = () => {
const [message, setMessage] = useState('Levi McLean\n123 Main St\nLondon, ON\n(555) 555-5555\naidanmclean111@gmail.com');
const sendMessageWithSMS = async () => {
const isAvailable = await SMS.isAvailableAsync();
if (isAvailable) {
const recipients = ['+15195351398']; // Replace with the recipient's phone number
const options = {
recipients: recipients,
message: message,
};
await SMS.sendSMSAsync(options.recipients, options.message)
.then((result) => {
if (result.result === 'sent') {
Alert.alert('SMS sent successfully');
} else {
Alert.alert('Failed to send SMS');
}
})
.catch((error) => {
Alert.alert('Error sending SMS');
});
} else {
Alert.alert('SMS is not available on this device');
};
};
const onChangeHandler = (value) => {
setMessage(value);
};
return (
<View style={styles.form}>
<Text style={styles.label}>You are going to send the following info:</Text>
<Text style={styles.messageInfo}>{message}</Text>
<Button title="Send via SMS" onPress={sendMessageWithSMS} />
</View>
);
}
const styles = StyleSheet.create({
form: {
padding: 30,
marginTop: 60,
},
label: {
fontSize: 18,
marginBottom: 30,
textAlign: 'center',
},
messageInfo: {
fontSize: 16,
marginBottom: 15,
textAlign: 'center',
fontWeight: 'bold',
},
});
export default SendSMS;