ddl script

Operate MySQL

The operation of MySQL there are two ways, namely:
A. Using the Command Line Interface (CLI) - For example the command prompt
on windows, linux and unix on a terminal.
2. Tool use WYSIWYG (What you see is what you get) - Examples
such as: XAMPP, MySQL-Front, SQLyog, phpMyAdmin, DBDESIGNER, etc..
In this module we will first study the operation of MySQL
by using a Command Line Interface (CLI) using the command
existing prompt on the Windows operating system. To Mysql we will
using XAMPP, why do we use xampp? Because xampp is
programs that already include Mysql Server, Webserver, database manipulation tools
web bases such as phpMyAdmin.
1. Go to the Program Directory by:
Go to the DOS prompt and then Type the command:
cd \
cd xampp \ mysql \ bin
KomunitasMengoperasikan MySQL
The operation of MySQL there are two ways, namely:
A. Using the Command Line Interface (CLI) - For example the command prompt
on windows, linux and unix on a terminal.
2. Tool use WYSIWYG (What you see is what you get) - Examples
such as: XAMPP, MySQL-Front, SQLyog, phpMyAdmin, DBDESIGNER, etc..
In this module we will first study the operation of MySQL
by using a Command Line Interface (CLI) using the command
existing prompt on the Windows operating system. To Mysql we will
using XAMPP, why do we use xampp? Because xampp is
programs that already include Mysql Server, Webserver, database manipulation tools
web bases such as phpMyAdmin.
VII.1. Go to the Program Directory by:
Go to the DOS prompt and then Type the command:
cd \
cd xampp \ mysql \ bin
community

2. Sign in to MySQL client programs
Give the command: mysql-u root press Enter

3. Making Database and Table

5 Command DDL (Data Definition Language)

Post an this is my project work on the SQL DML command … may be useful for readers wrote … :)

Overview of the SQL …

SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases. The entire database applications on the market, both free and is licensed, adopt the SQL language for database processing. There are two types of command in SQL, the DDL and DML.

DDL (Data Definition Language) is a SQL command associated with the definition of a database and tables.Some basic commands are included in the DDL, among others.

A. CREATE

Function: CREATE Command is working to create a database or create a table inside the database.

Syntax: CREATE database_name database;

Parameters: -

Example: CREATE pharmacy database;

Explanation: CREATE command above will create a database with the name of the pharmacy.

2. SHOW

Function: This function SHOW Command to display the database or table that we created earlier.

Syntax: SHOW databases;

Parameters: -

Example: SHOW databases;

Explanation: The SHOW command above will show all the existing database.

3. USE

Function: USE Command is working to open / activate / enter the database we have created. Once we enter into the database we have created, then we can manipulate existing data, including to create a table in the database.

Syntax: USE database_name;

Parameters: -

Example: USE pharmacies;

Explanation: The command above will enable the database with the name of the pharmacy so that we can manipulate the data.

4. ALTER

Function: ALTER Command is working to change the structure of a table. Change here is not simply renew the existing table structure, but also changed the name of the field, adding a primary key, change the field type, or delete fields that have been made previously.

Syntax: ALTER TABLE table_name parameter_option;

Parameters: add, modify, drop

Example: ALTER TABLE ADD medication price int (6);

Explanation: The command above will add a field into the price of the drug table.

5. DROP

Function: DROP Command is working to remove, either database, table, or field that has been entered into the table.

Syntax: DROP TABLE table_name;

Parameters: -

Example: DROP TABLE supplier;

Explanation: The command above will remove the table supplier in the pharmacy database.

block Porn Sites With Nawala

At present the development of internet technology world is remarkable, especially rapidly. Even according to the last survey data is now Indonesia was ranked 5th Asia the most access to the internet every day. This is understandable because the more people who install internet connection in their homes. But so much of technological development is not balanced with the knowledge of the benefits and usefulness. Lots of parents do not know how to filter the internet connection at home so that family members are not eligible (such as children) can access the web that contain lots of elements of pornography or violence. Not to mention if the cafe-cafe that has not knowingly or intentionally do not block sites that conflict with religion, This is the one of the main factors why the case of pornography in Indonesia such as was never completed. In line with the City Government who want to make the city of Bogor as lawful where all the content like porn, and violence will be eliminated. So Ebenk789 Weblog wants to invite all readers to begin to clean up starts from its own virtual world and the people closest to, because the supposed “Development of Information Technology and runs parallel to the Moral and Religious”

To clean up our virtual world of Esek Esek Actually, a lot of software that provides facilitation such as firewalls or antiporn. But for menggunaknnya bit difficult and must buy it first. Well here I will give you some tips for our internet safe and free of negative things, especially porn site.

A. Using the fiture of Nawala.org

Newsletters which archipelago is a free service used by internet users who need a filter negative sites. Net newsletter will help filter the type of negative sites that are not in accordance with the laws and regulations, values ​​and social norms, customs and morals of Indonesia such as pornography and gambling. Besides, Nusantara Newsletters will also filter out Internet sites that contain malicious content such as malware, phishing sites (deception) and the like.

How to use it as follows:

A. Right-click on the Network icon bottom right corner> Right Click> ChooseStatus> click Properties (if the icon is not listed, click start> My Network Place> click View Network Conection> Double Clik network icon in use> click Properties)

2. Double Click Internet Protocol [TPC / IP]

3. Fill Colom Preferred DNS Server and Alternative DNS Server numbers180 131 145 145 180 131 144 144 and> click Ok

Done .. :)

If you follow the correct steps then it should have access to all the negative sites will be blocked by the newsletter. To test please visit porn sites you know.

find out more about the newsletter please visit the official website athttp://www.nawala.org/

Weaknesses of its own newsletter that is if the child or the person aware of the IP newsletter then simply removing the IP numbers were, all sites can be accessed again.

To prevent that from happening then you should access the administrator account on your PC only to find out and use it. And for the user or the child is better to use just a guest.

There is also another way to block unwanted sites and use concepts such as newsletters and the server can be done by everyone.

  1. Open C: \ WINDOWS \ system32 \ drivers \ etc
  2. Open file Hosts
  3. Add sites that you want to block as shown below 
  4. Note: the left is filled with numbers 127.0.0.1 The right side is filled with the address you want to block sites

Way above the more potent because only a few people will realize you do the above techniques. but the weakness we have to write one by one we want to block sites and of course must know beforehand what site we want to block :)

May be useful : D

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