July 2012 | Killjols July 2012 | Killjols
Get Update Everyday Like Our FB Pages

Saturday

HAHAHA HAHAHA HAHAHA HAHAHA HAHAHA
Chord List: # | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z : TOP 10

DATATYPE MYSQL

MySQL uses all the standard ANSI SQL numeric data types, so if you're coming to MySQL from a different database system, these definitions will look familiar to you. The following list shows the common numeric data types and their descriptions.

INT - A normal-sized integer that can be signed or unsigned. If signed, the allowable range is from -2147483648 to 2147483647. If unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 digits.

TINYINT - A very small integer that can be signed or unsigned. If signed, the allowable range is from -128 to 127. If unsigned, the allowable range is from 0 to 255. You can specify a width of up to 4 digits.

SMALLINT - A small integer that can be signed or unsigned. If signed, the allowable range is from -32768 to 32767. If unsigned, the allowable range is from 0 to 65535. You can specify a width of up to 5 digits.

MEDIUMINT - A medium-sized integer that can be signed or unsigned. If signed, the allowable range is from -8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215. You can specify a width of up to 9 digits.

BIGINT - A large integer that can be signed or unsigned. If signed, the allowable range is from -9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to 18446744073709551615. You can specify a width of up to 11 digits.

FLOAT(M,D) - A floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 10,2, where 2 is the number of decimals and 10 is the total number of digits (including decimals). Decimal precision can go to 24 places for a FLOAT.

DOUBLE(M,D) - A double precision floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 16,4, where 4 is the number of decimals. Decimal precision can go to 53 places for a DOUBLE. REAL is a synonym for DOUBLE.

DECIMAL(M,D) - An unpacked floating-point number that cannot be unsigned. In unpacked decimals, each decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required. NUMERIC is a synonym for DECIMAL.


Date and Time Types:

The MySQL date and time datatypes are:

DATE - A date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example, December 30th, 1973 would be stored as 1973-12-30.

DATETIME - A date and time combination in YYYY-MM-DD HH:MM:SS format, between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 in the afternoon on December 30th, 1973 would be stored as 1973-12-30 15:30:00.

TIMESTAMP - A timestamp between midnight, January 1, 1970 and sometime in 2037. This looks like the previous DATETIME format, only without the hyphens between numbers; 3:30 in the afternoon on December 30th, 1973 would be stored as 19731230153000 ( YYYYMMDDHHMMSS ).

TIME - Stores the time in HH:MM:SS format.

YEAR(M) - Stores a year in 2-digit or 4-digit format. If the length is specified as 2 (for example YEAR(2)), YEAR can be 1970 to 2069 (70 to 69). If the length is specified as 4, YEAR can be 1901 to 2155. The default length is 4.

String Types:

Although numeric and date types are fun, most data you'll store will be in string format. This list describes the common string datatypes in MySQL.

CHAR(M) - A fixed-length string between 1 and 255 characters in length (for example CHAR(5)), right-padded with spaces to the specified length when stored. Defining a length is not required, but the default is 1.

VARCHAR(M) - A variable-length string between 1 and 255 characters in length; for example VARCHAR(25). You must define a length when creating a VARCHAR field.

BLOB or TEXT - A field with a maximum length of 65535 characters. BLOBs are "Binary Large Objects" and are used to store large amounts of binary data, such as images or other types of files. Fields defined as TEXT also hold large amounts of data; the difference between the two is that sorts and comparisons on stored data are case sensitive on BLOBs and are not case sensitive in TEXT fields. You do not specify a length with BLOB or TEXT.

TINYBLOB or TINYTEXT - A BLOB or TEXT column with a maximum length of 255 characters. You do not specify a length with TINYBLOB or TINYTEXT.

MEDIUMBLOB or MEDIUMTEXT - A BLOB or TEXT column with a maximum length of 16777215 characters. You do not specify a length with MEDIUMBLOB or MEDIUMTEXT.

LONGBLOB or LONGTEXT - A BLOB or TEXT column with a maximum length of 4294967295 characters. You do not specify a length with LONGBLOB or LONGTEXT.

ENUM - An enumeration, which is a fancy term for list. When defining an ENUM, you are creating a list of items from which the value must be selected (or it can be NULL). For example, if you wanted your field to contain "A" or "B" or "C", you would define your ENUM as ENUM ('A', 'B', 'C') and only those values (or NULL) could ever populate that field.
SHARE SHARE SHARE

HAHAHA HAHAHA HAHAHA HAHAHA HAHAHA
Chord List: # | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z : TOP 10

Example of MySql command

-EXAMPLE COMMAND-

Create a database on the sql server.

mysql> create database [databasename];

List all databases on the sql server.

mysql> show databases;

Switch to a database.

mysql> use [db name];

To see all the tables in the db.

mysql> show tables;

To see database's field formats.

mysql> describe [table name];

To delete a db.

mysql> drop database [database name];

To delete a table.

mysql> drop table [table name];

Show all data in a table.

mysql> SELECT * FROM [table name];

Returns the columns and column information pertaining to the designated table.

mysql> show columns from [table name];

Show certain selected rows with the value "whatever".

mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

Show all records containing the name "Bob" AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';

Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.

mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;

Show all records starting with the letters 'bob' AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';

Show all records starting with the letters 'bob' AND the phone number '3444444' limit to records 1 through 5.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;

Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.

mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";

Show unique records.

mysql> SELECT DISTINCT [column name] FROM [table name];

Show selected records sorted in an ascending (asc) or descending (desc).

mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;

Return number of rows.

mysql> SELECT COUNT(*) FROM [table name];

Sum column.

mysql> SELECT SUM(*) FROM [table name];


To update info already in a table.

mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';

Delete a row(s) from a table.

mysql> DELETE from [table name] where [field name] = 'whatever';

Update database permissions/privilages.

mysql> flush privileges;

Delete a column.

mysql> alter table [table name] drop column [column name];

Add a new column to db.

mysql> alter table [table name] add column [new column name] varchar (20);

Change column name.

mysql> alter table [table name] change [old column name] [new column name] varchar (50);

Make a unique column so you get no dupes.

mysql> alter table [table name] add unique ([column name]);

Make a column bigger.

mysql> alter table [table name] modify [column name] VARCHAR(3);

Delete unique from table.

mysql> alter table [table name] drop index [colmn name];

Create table with default and constraint.

mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');

Add column in between after other column.

mysql> ALTER TABLE contacts ADD email VARCHAR(60) AFTER name;

Add column the be the first column.

mysql> ALTER TABLE contacts ADD email VARCHAR(60) FIRST;

Add primary key.

mysql> alter table employees add primary key (empid);

Insert multiple value.

INSERT INTO [table]
( [field1], [field2], [field3] ) VALUES
( '[value1.1]', '[value1.2]', '[value1.3]' ),
( '[value2.1]', '[value2.2]', '[value2.3]' ),
( '[value3.1]', '[value3.2]', '[value3.3]' );

Change column name(date to dateofbirth).

mysql> alter table employees change date dateofbirth date;

Select / display Minumun or lowest
(salary =columnname,minsalary=newcolumn name,employee=table) .

mysql> select min(salary)as MinSalary from employee;

Select / display maximum or highest.

mysql> select max(salary)as MaxSalary from employee;

Select / display average.

mysql> SELECT avg( mark ) FROM student;

Display unique or no repeat value.

mysql> SELECT distinct [column1], [column2]
FROM [table];


REFERENCES:




SHARE SHARE SHARE

Thursday

HAHAHA HAHAHA HAHAHA HAHAHA HAHAHA
Chord List: # | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z : TOP 10

Keluh


Mengeluh..yup aku seorang yg suka mengeluh...kalau tak di mulut dalam hati...
kadang2 kerja dah siap pun aku still mengeluh...lumrah manusia x pernah nak rasa cukup..
dalam aku mengeluh2..aku rasa bersyukur ...dalam ape jua keadaan ada juga jalan penyelesaian nye..dan berapa ramai lagi yg nak berada di tempat kita di saat kita mengeluh...apalah sangat dugaan yang kita tempuh berbanding dgn cabaran dan dugaan mereka yg tengah bermati-matian untuk terus hidup.teringat kata-kata kawan aku ketika aku di asrama dulu...bila dia bangun je pagi..dia akan cakap "teruskan perjuangan untuk meneruskan hidup" haha kadang2 aku rasa nak tergelak..sebab dia ckp cam hari2 kitorang kais pagi makan pagi...padahal makan pun free je kat asrama...just bangun pergi kantin makan dah...tp betul jgak ape yg dia ckp...setiap kali kita bangun dari tidur...sebenarnye kita telah di beri kesempatan oleh tuhan untuk teruskan hidup hari ini...so perjuangan semalam yang masih tak di lakukan perlu lakukan untuk hari ini...mungkin esok xde lagi untuk kita.. cuma situasi kita berlainan...mungkin kita bangun untuk menempuh peperiksaan akhir...mungkin ada yang bangun di medan perang....mungkin ada yang bangun untuk mencari sesuap nasi..
mungkin ada yang bangun untuk tidur balik(sebab x cukup tidur semalam) hehehe...dan macam2 lagi hari2 yang perlu kita tempuh...cuma satu je aku kesal ...aku suka sgt mengeluh...mungkin dah jadi habit...habit ni tersangat la buruk(jgan ikut)...mungkin aku xtau nak lepaskan perasaan aku camner...so dengan mengeluh la jadi medium pelepasan perasaan aku...pelepasan pun bleh...tp sungguh la x elok camni..sentiasa la igt kat diri supaya bersyukur....aku terbaca satu ayat kat twitter..."kadang2 bila kita tgk masalah orang lain lebih besar dari masalah kita, masalah kita akan menjadi sangat kecil"...so itu mungkin satu cara nak muhasabah diri untuk sedar di mana kita berpijak...dan siapa diri kita...kalau kita susah ada yang lagi susah dari kita....kalau kita kuat akan ada yang lagi kuat...so lebih baik berserdehana....nak mengeluh pun biar berpada...cepat2 igt tuhan...(tgk cermin cakap ngan diri sendiri)..

“Sesungguhnya manusia diciptakan bersifat keluh kesah lagi kedekut. Apabila dia ditimpa kesusahan, dia berkeluh kesah dan apabila dia mendapat kebaikan dia amat kedekut.” [ 70 : 19-21 ]


kadang2 aku rasa nak luah kan keluhan aku...tp bila aku baca status facebook..budak2 x cukup umur nye mengeluh 24 jam....aku rasa cam terlalu tua untuk mengeluh?...kah3....

So kesimpulan dari semua ini..."BERSYUKURLAH"


"satu dua tiga dan empat
cuba berkali masih tak dapat
lupakan sakit, segan dan penat
nanti di puncak pasti terubat."

malique - cuba lagi

SHARE SHARE SHARE

Tuesday

HAHAHA HAHAHA HAHAHA HAHAHA HAHAHA
Chord List: # | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z : TOP 10

Sekali lagi...



Ya Allah Ya Rahman. Hari ini, aku memungkiri lagi janji taubatku..

Aku kembali mengulangi kesilapan lalu
Aku merelakan diriku dibuai godaan Nafsu
Aku biarkan diriku ditipu pujukan Syaitan

Sudah berkali-kali aku menzalimi diriku sendiri
Sudah berkali-kali aku merosakkan imanku sendiri
Walaupun aku sedar Engkau Maha Melihat
Walaupun aku sedar adanya Malaikat pencatat
Walaupun aku sedar dosa mengundang azab

Entah apa sudah jadi dengan diriku ini
Terasa Iman dijiwa semakin parah
Semakin lemah dan semakin rosak
Ketakutanku terhadap azabMu semakin kurang
Semakin pudar seakan lenyap

Aduh..teruknya diriku..

Ya Allah
Berilah aku kekuatan dan petunjuk
Agar mampu kutewaskan rayuan Nafsu dan Syaitan
Yang sangat hebat membinasakan diriku
Sangat bijak menjauhkan diriku daripadaMu
Sehingga aku lalai dalam urusan kehidupanku
Sehingga aku lupa dan tidak peduli akan kehidupan selepas matiku


Ya Allah
Bagaimanalah kedudukanku disisiMu?
Adakah diriku yang penuh dosa ini akan terselamat di akhirat sana?
Adakah aku antara manusia yang bakal memenuhi Neraka Jahanam?
Lalu aku hidup dalam binasa celaka buat selamanya?

Aku tidak mahu ya Allah
Aku tidak mahu masuk dalam golongan itu!
Aku tidak mahu hidup senang di dunia tapi sengsara di akhirat!
Aku tidak mahu...

Ya Allah..
Maafkanlah diriku
Tolong maafkan diriku
Ampunkanlah segala dosa yang aku kerjakan selama ini
Ampunkanlah segala dosa yang aku anggap remeh selama ini
Terlalu banyak..tidak terhitung..
Ampunkanlah Ya Allah
Ampunkanlah Ya Allah
Bersihkanlah diriku ya Allah
Sesungguhnya aku sangat berkehendak akan SyurgaMu!!

Aku merayu penuh harap
Lindungillah diriku daripada mengulangi kembali dosa lalu
Suburkanlah kekuatan iman dalam tekadku
Agar aku mampu mengusahakan yang terbaik dalam hidupk
Semata-mata untuk beroleh Syurga FirdausMu


Redhailah diriku Ya Allah
Redhailah keluargaku Ya Allah
Redhailah sahabat-sahabatku Ya Allah
Rahmatilah kami Ya Allah..
Rahmatilah..
Rahmatilah..

Duhai jiwa yang resah..
hayatilah pujukan murni daripada Allah ini..

Katakanlah: "Hai hamba-hamba-Ku yang malampaui batas terhadap diri mereka sendiri, janganlah kamu berputus asa daripada rahmat Allah. Sesungguhnya Allah mengampuni dosa-dosa kesemuanya. Sesungguhnya Dia-lah Yang Maha Pengampun lagi Maha Penyayang."
[39:53]
SHARE SHARE SHARE