Calendar
May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  
Statistic
Earn Cash by using your Blog

ddl script

Operation DDL (Data Definition Language)

DDL is a language that is used to manage or define a table.

Statements is:

  1. CREATE
  2. ALTER
  3. RENAME
  4. DROP
  5. TRUNCATE

In this article we will discuss about how to make table using the CREATE

In the manufacture of table and column names are the requirements to be met are:

  1. Must begin with alphabetic
  2. name length must be 1-30 characters
  3. Can only use AZ, az, 0-9, _, $, and #
  4. The table name and the name of His column should not be the same as the names and columns in other tables, the same user
  5. May not use names that have been reserved by the Oracle Server
    such as: FROM, INSERT, WHERE, and others

Syntax is as follows:

CREATE TABLE [table_name] (

[Column_name] [type_kolom] [size column]

)

-Create a table MsEmployee

CREATE TABLE MsEmployee
(
EmployeeID CHAR (5),
EmployeeName VARCHAR (20),

Email varchar2 (20),
Address varchar2 (30),
Salary NUMBER (10,2)

)

-Create a table TrHeaderTransaction

CREATE TABLE TrHeaderTransaction

(
TransactionID CHAR (5),
CustomerlD CHAR (5),
TransactionDate DATE

)

Keep in mind, the table above belom interconnected. We can connect the two tables by using Constraint.

Usefulness CONSTRAINT:

  1. Creating rules in the table
  2. Avoid the pen-delete-an on the table if the table has a dependence
  3. Constraint Type is valid is as follows:
  1. PRIMARY KEY
  2. FOREIGN KEY
  3. NOT NULL
  4. UNIQUE
  5. CHECKED

Guidelines in using Constraint:

  1. We can provide the constraint name manually or can be generates by the Oracle Server using the command SYS_cn
  2. Constraint-making can be conducted simultaneously at the time we create a table or the table is completed by using the Alter Table command
  3. Defining the constraint can be performed on the column level or table level
Constraint syntax is as follows:

CONSTRAINT [nama_constraint] [TYPE_CONSTRAINT]

-Making MsEmployee tables by using column-level constraint

CREATE TABLE MsEmployee
(
EmployeeID CHAR (5) PRIMARY KEY NOT NULL,
Cs002 CONSTRAINT CHECK (LENGTH (EmployeeID) = 5),
EmployeeName VARCHAR2 (20) NOT NULL,
Email varchar2 (20) UNIQUE,
Address varchar2 (30) NOT NULL,
Salary NUMBER (10,2) NOT NULL

)

-Making TrHeaderTransactiondengan tables using table-level constraint

CREATE TABLE TrHeaderTransaction
(
TransactionID CHAR (5) NOT NULL,
EmployeeID CHAR (5) NOT NULL,
TransactionDate DATE NOT NULL,
AAB CONSTRAINT PRIMARY KEY (TransactionID),
Cs005 CONSTRAINT CHECK (LENGTH (TransactionID) = 5),
Ngehubungin CONSTRAINT FOREIGN KEY (EmployeeID) REFERENCES MsEmployee (EmployeeID) ON DELETE CASCADE

)

Explanation:

  • NOT NULL CONSTRAINT is used to ensure the column is filled so that no value is empty
  • CONSTRAINT CHECKED used to check whether the data has been in accordance with predefined rules. In the above examples should be 5 characters long TransactionID not be less or more
  • UNIQUE CONSTRAINT is used to ensure there are no charging value or the same name on other data so as to prevent duplication of data
  • “Ngehubungin CONSTRAINT FOREIGN KEY (EmployeeID) REFERENCES MsEmployee (EmployeeID)” is used to link tables by table TrHeaderTransaction MsEmployee using EmployeeID EmployeeID as the connecting which is PRYMARY MsEmployee KEY of the table. Where Table MsEmployee as a parent and a child TrHeaderTransaction
  • CONSTRAINT ON DELETE CASCADE is used to ensure the event’s pen-delete the parent table row, child rows referencing the value of the data is also deleted but not vice versa.

In Oracle we can also use DEFAULT Syntax as initial value data
example:

CREATE TABLE EMPLOYEES2 (
Hire_Date DATE DEFAULT SYSDATE / * hire_date column filled with a date now without doing the INSERT * /
)

Copying or copy a table

In addition to creating the table above we can also make a table of the contents and data types together with other tables

example:

CREATE MsEmp2
U.S.
SELECT * FROM MsEmployees

we also can determine which columns are willing to be copied

CREATE MsEmp2
U.S.
EmloyeeId SELECT, FROM EmployeeName MsEmployees

above query is used to copy the table along with its contents, if we want to copy only the table columns without data content that is by adding WHERE 1 = 2

example:

CREATE MsEmp2
U.S.
MsEmployees SELECT * FROM WHERE 1 = 2

Database Concepts

Definition of Database

The database is a collection of related data
stored / organized jointly, in the form
in such a way, and without repetition (redundancy) that
not need to be 6 be recovered by
quickly and easily to meet various needs.
The purpose of the database or databases are:
a. Ease, accuracy and speed in decision
back data.
b. To handle the large amounts of data.
c. Ease of data access.
d. Eliminates redundancies and data inconsistencies.
2.8.2 Normalization
Become an accepted formal process to determine atributatribut
which should be grouped in bersamasama
in a relation.

Theory of Language Database
In database programming is divided into two kinds:
a. Data Definition Language (DDL)
DDL has a role:
1. Creating or Deleting Database.
2. Create, Change or Delete a Table.
3. Defining Constraints (Primary key, Foreign Key,
etc.)
b. Data Manipulation Language (DML)

DML has a role:
1. adding data
2. deleting data
3. changing the data
4. displaying the data

Glance About Sybase Power Designer 11

Sybase Power Designer 11 is a modeling tool released by Sybase for
build an information system that is fast, structured and effective. Sybase Power Designer 11
supports multiple modeling as follows:
• Requirements Management
• Business Process
• Data Modelling
• XML Modelling
• Application Modeling with UML
• Information Liquidity Modeling
• Integrated Modelling
In this tutorial we will try to use Power Designer to do the modeling
data (data modeling) for then we will use to perform database design.
Simply put, to perform data modeling in Power Designer, we have to begin at
level Conceptual Data Model, where the data modeling is done using the method Entity
Relationship Diagram. In the CDM, data type that is used is general and not specific
against a particular database.
The second stage is to create a Physical Data Model (PDM) PDM is a specific form of
CDM that we have built. Power Designer has a lot of support for the target database, sowe
not to be confused about the type - the type of data used, because the Power Designer will
adjust as the data type that we defined earlier in the stage of the CDM.
The last stage is the script generates Data Definition Language (DDL) of the PDM that has been
is made. Through this we can generate the DDL objects - database objects (tables, triggers, views,
procedure) then DDL scripts so that we can execute the software of other databases such as Oracle
or MySQL, or we can also create a connection and execute it directly via the PowerDesigner.

 

What is DDL & DML?

All SQL commands are divided into two broad categories according to its function,namely:
DDL - Data Definition Language
is a collection of SQL commands used to create, modify and delete metadata structuresand definitions of database objects.DML - Data Manipulation Language
is a collection of SQL commands that are used for processing the contents of the data inthe table such as insert, modify and delete the contents of the data - and not associatedwith changes in the structure and data type definitions of database objects.Let us see from the definition and more examples in the following sections below.
DDL - Data Definition LanguageAs the definition described above, DDL is a set of SQL commands that are used to make(create), modify (alter) and delete (drop) the structure and data type definitions ofdatabase objects.

Objects in the database in question - in MySQL - is as follows:
database
table
View
index
Procedure (Stored Procedure)
function
trigger
example:

 
DDL Commands list on the MySQL 5.0Here are examples of DDL commands used in MySQL. Click on the link to see details ofthe use of the command.
Making (CREATE)
CREATE DATABASE
CREATE FUNCTION
CREATE INDEX
CREATE PROCEDURE
CREATE TABLE
CREATE TRIGGER
CREATE VIEWChanges (ALTER & RENAME)
ALTER DATABASE
ALTER FUNCTION
ALTER PROCEDURE
ALTER TABLE
ALTER VIEW
RENAME TABLEElimination (DROP)
DROP DATABASE
DROP FUNCTION
DROP INDEX
DROP PROCEDURE
DROP TABLE
DROP TRIGGER
DROP VIEW
                                                                                          Matrix table DDL commands MySQL 5.0
 OBJECT CREATE  ALTER  DROP RENAME 
 DATABASE  Yes Yes  Yes
 FUNCTION  Yes Yes  Yes
 INDEX  Yes  Yes
 PROCEDURE  Yes Yes  Yes
 TABLE  Yes Yes  Yes  Yes
 TRIGGER  Yes  Yes
 VIEW  Yes Yes  Yes
DML - Data Manipulation LanguageDML it self is a collection of SQL statements that relate to the job processing the data in thetable - and not associated with changes in the structure and data type definitions ofdatabase objects such as table, column, and so on.Examples of DML: Taking All the Row Data from the table MS_KARYAWAN

DML Example: Inserting data into tables ms_karyawan

Some DML Commands list of MySQL 5.0CALL
DELETE
DO
HANDLER
INSERT
LOAD DATA INFILE
REPLACE
SELECT
TRUNCATE
UPDATE

What is a DLL Cleaner?

Desktop computers are similar in many works of modern engineering. Also start to feel slow and display inappropriate actions after being used for a while ‘. Because PCs are so integrated into our daily existence, a very slow PC can be aggravating. To improve the speed of your PC is running, you can enjoy and transmit DLL Cleaner.Take a moment to talk about this DDL Script is the information, before we talk about how to work DLLs products.

What are DLL files?

Select DLL or dynamic link information is specific information, which are among the various programs represented there is more space available on your PC. Unfortunately, there are times when people find it difficult to remove such information, which changes out to be a terrible mistake. Because the information is used by some DLLs a variety of important programs on your PC, delete the information can not be unhappy. When this information is broken, the basic functions of the PC may be affected in the same way.

For your PC to function properly, the relationship described by information DLL must be present. If this information is broken, goes through your PC’s performance.

The cause of DLL errors

DLL errors occur when a particular softwaree is in place or removed on your PC. How softwaree other programs and share the same DLL file, it is likely that one of these may change or even delete the DLL. You can also find several variants of information as a DLL build on the programs you have. This can lead to performance of value for other programs.In this spirit, it is important that you create the edition establish appropriate DLL with other programs on your PC. This will ensure that all programs are working properly.

DLL errors can also occur when you have lower quality components, such as a hard drive or disk part of a faulty memory. You can also get a problem DLL if you have a Windows registry infected.

How can we fix DLL errors?

Whenever there is a problem of DLL, the psychological steps should be taken as soon as possible. You can choose to use a complete edition of Windows registry units with a DLL made clearer. You get what you have errors on your PC restored with the help of a reader of the Windows registry.

Requests an effective player windows registry all your PC and determines the DLL errors.Softwaree This also helps to restore DLL errors so that your career gets easier. Just configure the unit for softwaree Windows Registry and fix DLL errors is available with optional automatic reader program.

Products DLLs are valuable because they can remove all DLL errors on your PC, you can help your PC run faster. In addition, repair Windows Registry is softwaree PC that is able to function correctly as possible. If you notice that your PC does not work as fast as usual, you can use a DLL sharper.

The operating system can be played fast, safe and successful stuck with the Windows registry. You will be able to stimulate the operation of your PC if you get a disk of the Windows registry with a DLL in it clearer. It is not necessary to improve all components of your PC. You can find many products in the Windows registry by searching the Internet. In less than an hour you will have your PC running much faster than it was before with DLL errors faded.