Kamis, 22 November 2012

When your text data type exceeds 255 characters

BY ALBERT ANTHONY D. GAVINO

A TEXT data type is a data type that establishes a field that can store text, or a combination of text and numbers (alphanumeric), but whose numbers are not used for calculations. Examples are phone numbers or e-mail addresses. When you create your tables through the Access user interface, you have two basic text types: TEXT and MEMO. But when you use SQL statements such as CREATE TABLE or ALTER TABLE to create your tables, you have many other synonyms of the TEXT and MEMO types to choose from.

In general, text fields can be up to 255 characters, while memo fields can be up to 65,535 characters, but if the memo field does not contain any binary data, then its only limit is the maximum size of the database (approximately 2.14GB or 1,070,000,000 Unicode characters). In addition, unused portions of text fields are not reserved in memory.

Personal Take:


When importing a text data type that exceeds more than 255 character, choose the MEMO type field option which has about 65, 535 characters, but this will also affect the size of your database and the speed of every query processed.


Minggu, 18 November 2012

Structural Equation Modeling (SEM) Endogenous variable

ENDOGENOUS VARIABLE

a : caused by factors inside the organism or system
b : produced or synthesized within the organism or system


this one was based on research taken from 
http://www.tcrecord.org/Content.asp?ContentId=16924

DATA ANALYSIS

The proposed conceptual model was tested by using structural equation modeling (SEM) analysis. Taking into consideration measurement errors that are often inherent in survey data, SEM defines latent, multidimensional constructs (e.g., parents’ expectations, students’ motivational beliefs) and observed variables (e.g., baccalaureate expectations) while testing the theoretical links and their directions among the key variables in the study. Rooted in psychology, psychometrics, and econometrics, SEM is an appropriate approach to testing whether an a prioristructural model fits the observed data grounded in relevant literature and theory (Kaplan, 2000). By and large a confirmatory (i.e., hypothesis testing) technique, SEM consists of two parts: (1) a measurement model based on a confirmatory factor analysis that connects latent variables to observed indicator variables; and (2) a structural model that uses path analysis that accounts for relationships among endogenous, exogenous, and latent variables according to the a priori theoretical framework (Kaplan, 2000; Schreiber Stage, King, Nora, & Barlow, 2006). Figure 2 describes the SEM diagram based on the theoretical model in Figure 1.






Rabu, 14 November 2012

Appending your table in MS Access


Overview

An append query selects records from one or more data sources and copies the selected records to an existing table.
For example, suppose that you acquire a database that contains a table of potential new customers, and that you already have a table in your existing database that stores that kind of data. You'd like to store the data in one place, so you decide to copy it from the new database into your existing table. To avoid entering the new data manually, you can use an append query to copy the records.

Benefits of using an append query

By using a query to copy data, you can:
  • Append multiple records in one pass    If you copy data manually, you usually have to perform multiple copy/paste operations. By using a query, you select all the data at once, and then copy it.
  • Review your selection before you copy it    You can view your selection in Datasheet view and can make adjustments to your selection as needed before you copy the data. This can be particularly handy if your query includes criteria or expressions, and you need several tries to get it just right. You cannot undo an append query. If you make a mistake, you must either restore your database from a backup or correct your error, either manually or by using a delete query.
  • Use criteria to refine your selection    For example, you might want to only append records of customers who live in your city.
  • Append records when some of the fields in the data sources don't exist in the destination table     For example, suppose that your existing customer table has eleven fields, and the new table that you want to copy from only has nine of those eleven fields. You can use an append query to copy the data from the nine fields that match and leave the other two fields blank.

Basic steps of an append query

The process of creating an append query follows these basic steps:
  • Create a select query    You start by selecting the data that you want to copy. You can adjust your select query as needed, and run it as many times as you want to make sure you are selecting the data that you want to copy.
  • Convert the select query to an append query    After your selection is ready, you change the query type to Append.
  • Choose the destination fields for each column in the append query    In some cases, Access automatically chooses the destination fields for you. You can adjust the destination fields, or choose them if Access did not.
  • Preview and run the query to append the records    Before you append the records, you can switch to Datasheet view for a preview of the appended records.
 IMPORTANT   You cannot undo an append query. Consider backing up your database or the destination table. For more information about backing up a database, see the article Back up a database.

Kamis, 08 November 2012

Using the Auto Classifier in IBM Data Modeler

BY ALBERT ANTHONY D. GAVINO

The IBM Data Modeler, the Auto Classifier under the Models tab is useful when you are not sure which Predictive Model to use, IBM Data Modeler gives you this benefit to make things easier and efficient, after which you can choose a specific model such as CHAID or C&R Tree and Data Modeler will do all the work for you, take note of the Gold Icons, these are your Models created from your data sets and your data filters, each model has its own accuracy depending on the nature of your data.


Tip: Always save your stream and your data file in one folder, this will help in preventing from errors in happening such as lost file stream or lost database, Do not put your files on your desktop and your stream file in another folder as this will cause problems in the future.

Have Fun with Data Modeling!

Rabu, 07 November 2012

SQL Statement Cheat Sheet

there are a bunch of SQL statements upon your disposal

SQL Statement
Syntax
AND / OR
SELECT column_name(s)
FROM table_name
WHERE condition
AND|OR condition
ALTER TABLE
ALTER TABLE table_name
ADD column_name datatype
or
ALTER TABLE table_name
DROP COLUMN column_name
AS (alias)
SELECT column_name AS column_alias
FROM table_name
or
SELECT column_name
FROM table_name  AS table_alias
BETWEEN
SELECT column_name(s)
FROM table_name
WHERE column_name
BETWEEN value1 AND value2
CREATE DATABASE
CREATE DATABASE database_name
CREATE TABLE
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name2 data_type,
...
)
CREATE INDEX
CREATE INDEX index_name
ON table_name (column_name)
or
CREATE UNIQUE INDEX index_name
ON table_name (column_name)
CREATE VIEW
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
DELETE (used to remove one or more rows in a table)
DELETE FROM table_name
WHERE some_column=some_value
or
DELETE FROM table_name
(Note: Deletes the entire table!!)

DELETE * FROM table_name
(Note: Deletes the entire table!!)
DROP DATABASE
DROP DATABASE database_name
DROP INDEX
DROP INDEX table_name.index_name (SQL Server)
DROP INDEX index_name ON table_name (MS Access)
DROP INDEX index_name (DB2/Oracle)
ALTER TABLE table_name
DROP INDEX index_name (MySQL)
DROP TABLE
DROP TABLE table_name
GROUP BY
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
IN
SELECT column_name(s)
FROM table_name
WHERE column_name
IN (value1,value2,..)
INSERT INTO
(used to add single or multiple rows to a table)
INSERT INTO table_name
VALUES (value1, value2, value3,....)
or
INSERT INTO table_name
(column1, column2, column3,...)
VALUES (value1, value2, value3,....)
INNER JOIN
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
LEFT JOIN
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
RIGHT JOIN
SELECT column_name(s)
FROM table_name1
RIGHT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
FULL JOIN
SELECT column_name(s)
FROM table_name1
FULL JOIN table_name2
ON table_name1.column_name=table_name2.column_name
LIKE
SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern
ORDER BY
SELECT column_name(s)
FROM table_name
ORDER BY column_name [ASC|DESC]
SELECT
SELECT column_name(s)
FROM table_name
SELECT *
SELECT *
FROM table_name
SELECT DISTINCT
SELECT DISTINCT column_name(s)
FROM table_name
SELECT INTO
SELECT *
INTO new_table_name [IN externaldatabase]
FROM old_table_name
or
SELECT column_name(s)
INTO new_table_name [IN externaldatabase]
FROM old_table_name
SELECT TOP
SELECT TOP number|percent column_name(s)
FROM table_name
TRUNCATE TABLE
TRUNCATE TABLE table_name
UNION
SELECT column_name(s) FROM table_name1
UNION
SELECT column_name(s) FROM table_name2
UNION ALL
SELECT column_name(s) FROM table_name1
UNION ALL
SELECT column_name(s) FROM table_name2
UPDATE
(used to modify a single column in one or more rows in a table)
UPDATE table_name
SET column1=value, column2=value,...
WHERE some_column=some_value
WHERE
SELECT column_name(s)
FROM table_name
WHERE column_name operator value

USE Master, Create Database, create a table

USE Master;
GO
CREATE DATABASE Sales;
GO
USE Sales;
GO
CREATE TABLE Contacts (
   ContactsID int NOT NULL,
   Lastname varchar(50) NOT NULL,
   Firstname varchar(50) NOT NULL,
   Phone varchar(30) NULL
 )

Adding data rows unto your table

INSERT INTO Contacts
         (ContactsID, Lastname, Firstname, Phone)
VALUES (101, 'Gavino', 'Albert', '5245505')
                (102, 'Amora', 'Johnny', 'NULL')
SELECT * FROM Contacts;