对于以下给定的架构,能否请我指导如何使用oracle和sqlplus编写简单的数据挖掘查询?
CREATE TABLE Location(Location_id NUMBER(5) NOT NULL, Location_name varchar(15) NOT NULL,PRIMARY KEY (Location_id));
CREATE TABLE Customer(customer_id NUMBER(5) NOT NULL, customer_name varchar(15) NOT NULL, customer_credit NUMBER(6) NOT NULL, PRIMARY KEY (customer_id));
CREATE TABLE Product(product_id NUMBER(5) NOT NULL, product_name varchar(10) NOT NULL, product_price NUMBER(6) NOT NULL, product_quantity NUMBER(6) NOT NULL, PRIMARY KEY (product_id));
CREATE TABLE Supplier(supplier_id NUMBER(5) NOT NULL, supplier_name varchar(15) NOT NULL, supplier_quantity NUMBER(5) NOT NULL,PRIMARY KEY (supplier_id));
CREATE TABLE Store (customer_id NUMBER(5) NOT NULL, supplier_id NUMBER(5) NOT NULL, product_id NUMBER(5) NOT NULL, location_id NUMBER(5) NOT NULL,sale NUMBER(9) NOT NULL,category varchar(9) NOT NULL);
ALTER TABLE Store ADD CONSTRAINT Store_fk0 FOREIGN KEY (customer_id) REFERENCES Customer(customer_id);
ALTER TABLE Store ADD CONSTRAINT Store_fk1 FOREIGN KEY (supplier_id) REFERENCES Supplier(supplier_id);
ALTER TABLE Store ADD CONSTRAINT Store_fk2 FOREIGN KEY (product_id) REFERENCES Product(product_id);
ALTER TABLE Store ADD CONSTRAINT Store_fk3 FOREIGN KEY (location_id) REFERENCES Location(Location_id);
我有以下我编写的OLAP查询,与数据挖掘查询没什么不同。还可以指导我如何针对以下内容编写更复杂的查询:
SELECT CUSTOMER.CUSTOMER_NAME,PRODUCT.PRODUCT_NAME,SALE FROM STORE INNER JOIN CUSTOMER ON STORE.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID INNER JOIN PRODUCT ON STORE.PRODUCT_ID = PRODUCT.PRODUCT_ID WHERE STORE.SALE = (SELECT MAX(SALE) FROM STORE);
我将不胜感激。
答案 0 :(得分:0)
这个问题太含糊,无法给出很好的答案。有关数据挖掘的更多信息,请参阅Oracle Data Mining。 数据挖掘从一个简单的查询开始,例如:
BEGIN
DBMS_PREDICTIVE_ANALYTICS.EXPLAIN(
data_table_name => 'mining_data_build_v',
explain_column_name => 'affinity_card',
result_table_name => 'ai_explain_output');
END;
/
天空是极限...