$%% ",-.,/ B + &! '() E F % 6: !!!"#$ " '*( ) > & *!!! "& +,!,, mysql [-h host] [-u user] [-p[pass]] % ' ?!!!

Size: px
Start display at page:

Download "$%% ",-.,/ B CB'D'179"CB'D'177 @ + &! '() E F % 6: !!!"#$ " '*( ) > & *!!! "& +,!,, mysql [-h host] [-u user] [-p[pass]] % ' ?!!!"

Transcription

1 "#$ " & '() '*( ) 13/04/06 [email protected] 2 "# $ "& mysql [-h host] [-u user] [-p[pass]] +,,, -... / 0' ' :, ;<<& += VERSION() CURRENT_DATE a-log row in set (0.01 sec) > & * "&? # + " ' ( )* $+& )* 13/04/06 [email protected] 3 13/04/06 [email protected] 4 + A 0'1 # 6: "## " B & '() & '() E F 13/04/06 [email protected] 5 13/04/06 [email protected] 6

2 ",.'/ " H ; B@ ;DB4DB;"'0CDB;"0-)D@0DB;"DB;"D(DB; C;")@-")-D0C ;DB4;-I;"'0C;-I;"0-)D@0;-I;";-I;"D(;-I; JC>"KC>JC>""-B@0"'-; )C;-";D0-")C;-;D0-"4-C>";D0-';C0? 0'1 + CB'DD''179L +LB@0->D")-D0C"DB;-(->" '0CDB;"+ C;">-C )@-?>-D'DB &DB; DB;-(-> &)- )-D0C B@0->D)-D0C +0'1" < '179 13/04/06 [email protected] 7 13/04/06 [email protected] 8 0'1 TINYINT, MEDIUMINT BIGINT ' 2'3 '5 8""1 2(543 ( ( 23(3343 3( '53(43 '53( ((5(43:55:33 9((5(43:55:35 8& ;,UNSIGNED,"&M < ZEROFILL -LINT(5) ZEROFILL 5::::5 < AUTO_INCREMENT 13/04/06 [email protected] 9 13/04/06 [email protected] 10.'/./ DECIMAL(M,D) NUMERIC(M,D) N & H*" O+ #& "& 0+&LL 966 )<+L#& "+ &+ L 8:"M-2 -Lsalaire + &")=:" <,< & -Lsalaire DECIMAL(5,2), '1 < 13/04/06 [email protected] 11 13/04/06 [email protected] 12

3 .(/ FLOAT& REALDOUBLE PRECISION < 0'1 HDOUBLE DOUBLE PRECISION FLOAT5 DOUBLE PRECISION"REALR FLOAT(p) 5 PQ95 R 96PQPQ68 DECIMAL(M,D) 0ST )Q: 0S9 )=: )S9 0P) 13/04/06 [email protected] 13 13/04/06 [email protected] 14 "; "0 8< TIMESTAMP:::::::::::::: <& DATE<::::,::,::<,,$ TIME<::::::< DATETIME<::::,::,::::::::< YEAR:::: TIMESTAMP N +< < U ;D0-';C0?"* # $ + TIMESTAMP(14) YYYYMMDDHHMMSS TIMESTAMP(12) YYMMDDHHMMSS TIMESTAMP(10) YYMMDDHHMM TIMESTAMP(8) YYYYMMDD TIMESTAMP(6) YYMMDD TIMESTAMP(4) YYMM TIMESTAMP(2) YY 13/04/06 [email protected] 15 13/04/06 [email protected] 16 " L& " V" *< 0'1* L& * '<<::,W7" 9:::,9:W7 '<<X:,77" T7X:,T777 13/04/06 [email protected] 17 ; DATE 8 DATETIME R TIMESTAMP 5 TIME 8 YEAR T 13/04/06 [email protected] 18

4 " =8>8=8 " =8>8=8 CHARVARCHAR " &** N &L JC> ) L966* Valeur CHAR(4) Taille VARCHAR(4) Taille '' ' ' 4 octets '' 1 octet 'ab' 'ab ' 4 octets 'ab' 3 octets 'abcd' 'abcd' 4 octets 'abcd' 5 octets 'abcdefgh' 'abcd' 4 octets 'abcd' 5 octets CHARVARCHAR "# +<DBC>4< & <DBC>4&+ " < *C'D 0'1 13/04/06 [email protected] 19 13/04/06 [email protected] 20 " 0?"@ $# H TINYTEXT"TINYBLOBSTP9 R TEXT"BLOB S9P9 TW MEDIUMTEXT"MEDIUMBLOB S8P9 95 LONGTEXT"LONGBLOB S5P9 LW6686?L" -B@0<L<"<<"<U< < +, L * B@B@ <:<L<T<<9<U<8 13/04/06 [email protected] 21 13/04/06 [email protected] 22 "01 " 0.'/ ENUM & < "&L# <"ENUM N& L?L"<<*<<< ENUM('a','b')"<<*<< < U " A & SET " &,<"< +&+<SET A 13/04/06 [email protected] 23 13/04/06 [email protected] 24

5 " 0./ " W5?L" &+ SET('un','deux') NOT NULL < : '' 'un' 'deux' 'un,deux' ' &U SET" SET + B@*? < '-;"< << < < < +"+ <H+<& "< #?L" & SET('a','b','c','d')" <"<"<"<" <""""< <"< 13/04/06 [email protected] 25 13/04/06 [email protected] 26 A# # & B$ ""#" W5 ; &<<"<3<<< ; W5 ; &<<<< W5 ; DL W5 ; C 966 ; B U+& " *L" U <Y< `test`.`toto`.`titi` -0'1" # #&? +"# *# &+ # / 13/04/06 [email protected] 27 13/04/06 [email protected] 28 * * $ 'J/JC>C;->'-;2 'J/C;DBDG-<TZ<2 "$' $ & $ T[ < T T[[ ) B T[[ 0 T[[ 0"# T[T[ C)DB,T T[9[ C)DB,9 T[[ - T[[ ' & 13/04/06 [email protected] 29 13/04/06 [email protected] 30

6 " CREATE DATABASE [IF NOT EXISTS] db_name [create_specification [,create_specification]...] create_specification: [DEFAULT] CHARACTER SET charset_name [DEFAULT] COLLATE collation_name ALTER DATABASE db_name alter_specification [,alter_specification]... alter_specification: [DEFAULT] CHARACTER SET charset_name [DEFAULT] COLLATE collation_name DROP DATABASE [IF EXISTS] db_name? )>? )C;CC'-" U )>? )>?)C;CC'-& db_name data 0'1 13/04/06 [email protected] 31 13/04/06 [email protected] "0 CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] -L CREATE TABLE IF NOT EXISTS `test`.`t1` (a INT(11) UNSIGNED NOT NULL, b VARCHAR(4) DEFAULT 'toto', PRIMARY KEY (a)) 8"08"0 ALTER [IGNORE] TABLE tbl_name alter_spec [,alter_spec]... alter_spec: ADD [COLUMN] column_definition [FIRST AFTER col_name ] ADD [COLUMN] (column_definition,...) ADD INDEX [index_name] [index_type] (index_col_name,...) ADD [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...) ADD [CONSTRAINT [symbol]] UNIQUE [index_name] [index_type] (index_col_name,...) ADD [FULLTEXT SPATIAL] [index_name] (index_col_name,...) ADD [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...) [reference_definition] 13/04/06 [email protected] 33 13/04/06 [email protected] 34 8"08"0./ 06 ALTER [COLUMN] col_name {SET DEFAULT literal DROP DEFAULT} CHANGE [COLUMN] old_col_name column_definition [FIRST AFTER col_name] MODIFY [COLUMN] column_definition [FIRST AFTER col_name] DROP [COLUMN] col_name DROP PRIMARY KEY DROP INDEX index_name DROP FOREIGN KEY fk_symbol DISABLE KEYS ENABLE KEYS RENAME [TO] new_tbl_name ORDER BY col_name CONVERT TO CHARACTER SET charset_name [COLLATE collation_name] [DEFAULT] CHARACTER SET charset_name [COLLATE collation_name] DISCARD TABLESPACE IMPORT TABLESPACE table_options ALTER TABLE test.t1 RENAME test.t2 ALTER TABLE test.t2 ADD c INT(11) AFTER b ALTER TABLE test.t2 MODIFY a TINYINT NOT NULL,CHANGE b bb CHAR(20) ALTER TABLE test.t2 DROP COLUMN b 13/04/06 [email protected] 35 13/04/06 [email protected] 36

7 018 RENAME TABLE tbl_name TO new_tbl_name [,tbl_name TO new_tbl_name,...] DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name]... [RESTRICT CASCADE] C;;-B;DB &" \ )--;- ) JCB)-> DB'->; C))C;CDB D- >-?C- '--; ', 13/04/06 [email protected] 37 13/04/06 [email protected] 38 0"0 06 SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] [HIGH_PRIORITY] [DISTINCT DISTINCTROW ALL] col_name [AS alias],... [INTO {OUTFILE DUMPFILE} 'nom_fichier' export_options] [FROM tbl_name [AS alias] [,tbl_name [AS alias]...] [WHERE conditions] [GROUP BY {unsigned_int col_name expr} [ASC DESC],...] [HAVING where_definition] [ORDER BY {unsigned_int col_name expr} [ASC DESC],...] [LIMIT [offset,]count] [PROCEDURE procedure_name(argument_list)] [FOR UPDATE LOCK IN SHARE MODE]] SELECT x,y FROM `test`.`t2` SELECT * FROM `t3` SELECT `t3`.nom FROM `test`.`t3` SELECT `t3`.* FROM `test`.`t3` SELECT a AS x,y,1+z AS w FROM `t1` 13/04/06 [email protected] 39 13/04/06 [email protected] 40 SELECT x FROM t1 WHERE x>10 SELECT x FROM t1 WHERE x>10 AND y='toto' SELECT nom FROM t1 WHERE nom LIKE 'a' OR nom LIKE '_a' SELECT t1.*,t2.salaire FROM employes AS t1,infos AS t2 WHERE t1.name=t2.name 13/04/06 [email protected] 41 SELECT ville,count(*) AS N FROM personnes GROUP BY ville SELECT pays,ville,sum(nom) AS total FROM personnes GROUP BY pays,ville < : AVG(expr),BIT_AND(expr),BIT_OR(expr), BIT_XOR(expr),COUNT(expr),GROUP_CONCAT(expr) MIN(expr),MAX(expr),STD(expr),SUM(expr) 13/04/06 [email protected] 42

8 =8>1 JCKDB( & < " + /J->- SELECT nom,max(poids) FROM boxers GROUP BY nom HAVING SELECT college,region,ville FROM lycee ORDER BY region SELECT college,region,ville FROM lycee ORDER BY region ASC,ville DESC 13/04/06 [email protected] 43 13/04/06 [email protected] 44 " > 6 SELECT * FROM t1 LIMIT 5 > W#T6 SELECT * FROM t1 LIMIT 5,10 "6 L A & +A'1 )>)->4JCKDB( '--; ) '-; T (TRUE), : (FALSE) NULL 13/04/06 [email protected] 45 13/04/06 [email protected] $./ SELECT 1<=>1,NULL<=>NULL,1<=>NULL T"T": SELECT 1=1,NULL=NULL,1=NULL,'a'='A',BINARY 'a'='a' T"B@"B@"T": SELECT '.01' <> '0.01',.01 = '0.01' T": SELECT 2>2, 3>=2, 2<2, 2<=3 :"T":"T SELECT 1 BETWEEN 2 AND 3 : SELECT GREATEST(34.0,3.0,5.0,767.0),LEAST(2,4,8) XWX:"9 SELECT 2 IN (0,3,5,'wefwf'), 2 NOT IN (0,3,'wefwf') :"T > B@ SELECT COALESCE(NULL,10),COALESCE(NULL,NULL,NULL) T:"B@ SELECT NOT 10, (1+1), 1 && 0, 1 AND 1 :":":"T SELECT 1 0, 1 OR 1, 1 XOR 0 T"T"T 13/04/06 [email protected] 47 13/04/06 [email protected] 48

9 @ $.(/ "*$$E SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL :":"T SELECT 1 IS NOT NULL,0 IS NOT NULL,NULL IS NOT NULL T"T": SELECT ISNULL(1+1) : SELECT ISNULL(1/0) T IFNULL(expr1,expr2)<LT<B@" & D B@ <LT" <L9 NULLIF(expr1,expr2)<L LTQL9" & B@ LT 13/04/06 [email protected] 49 IF(expr1,expr2,expr3) <LT;>@- & D L9" L8 > Q, CASE valeur WHEN [compare-value] THEN resultat [WHEN [compare-value] THEN resultat...] [ELSE resultat] END > * +' <" -'- '<-'- B@ CASE WHEN [condition] THEN résultat [WHEN [condition] THEN résultat...] [ELSE résultat] END 13/04/06 [email protected] 50 F$$;G $$A.'/ F$$;G $$A./ ASCII(str) C'D* H*> :H *> B@H *B@ BIN(N) H* <B CONV(N,from_base,to_base) & HEX(N) TWCONV(N,10,16) OCT(N) RCONV(N,10,8) UNHEX(str) J-I BIT_LENGTH(str) H* CHAR_LENGTH(str) *H LENGTH(str) H" OCTET_LENGTH() -B(;J CHAR(N,...)* C'D H*B@ CONCAT(str1,str2,...) H > B@ B@ CONCAT_WS(separator,str1,str2,...)&BC;/ ' "<,#,] 13/04/06 [email protected] 51 13/04/06 [email protected] 52 F$$;G $$A.(/ F$$;G $$A./ ELT(N,str1,str2,str3,...) TBQT"9 BQ9"> B@B+T + < FIELD(str,str1,str2,str3,...) <L HT"9"8"^> :< INSERT(str,pos,len,newstr) H *"* H M# *" H REPLACE(str,from_str,to_str) H * H& [ H [ 13/04/06 [email protected] 53 INSTR(str,substr) * HH* LOCATE(substr,str) LOCATE(substr,str,pos) * HH *> : H * POSITION(substr IN str) C;-" SUBSTRING_INDEX(str,delim,count) H*" LEFT(str,len) *#H * RIGHT(str,len) *# H * 13/04/06 [email protected] 54

10 F$$;G $$A.:/ F$$;G $$A.4/ LCASE(str) /-> LOWER(str) H * UPPER(str) H$ LPAD(str,len,padstr) H*" #H*$+<#+H ** 'H* +*" * RPAD(str,len,padstr)?C)# REPEAT(str,count) H* & H' PQ:" H > B@ B@ REVERSE(str) H < * <H 13/04/06 [email protected] 55 QUOTE(str)*<H +L +A'1 LTRIM(str) H*L RTRIM(str) H*&L TRIM([[BOTH LEADING TRAILING] [remstr] FROM] str) H* &L &L SPACE(N) H B MID(str,pos,len) '@';>DB(" " SUBSTRING(str,pos) SUBSTRING(str FROM pos) SUBSTRING(str,pos,len) SUBSTRING(str FROM pos FOR len) H* H"# 13/04/06 [email protected] ;, F$ H;.'/ +, -, *, / DIV *$ 0'15T: CAST(expr AS type) CONVERT(expr,type) CONVERT(expr USING transcoding_name)0'15:9 A< DBC>4 JC> )C;- )C;-;D0- 'D(B-)_DB;-(->` CURDATE() & <4444,00,))< ))" L+ H CURTIME() < & <JJ00''< JJ00'' L+ H CURRENT_TIMESTAMPCURRENT_TIMESTAMP()"LOCALTIME LOCALTIME()"LOCALTIMESTAMPLOCALTIMESTAMP()"SYSDATE() B/ NOW() & <4444,00,))JJ00''< ))JJ00''" L+ H 13/04/06 [email protected] 57 13/04/06 [email protected] 58 F$ H;./ F$ H;.(/ & <4444,00,))< )) UTC_TIMEUTC_TIME() <@; & <JJ00''< JJ00''@;[;D0-';C0? UTC_TIMESTAMP() <@; & <4444,00,))JJ00''< ))JJ00'' UNIX_TIMESTAMP()UNIX_TIMESTAMP(date) <T7X:,:T,:T::::::<(0; FROM_UNIXTIME(unix_timestamp) <L[ & <4444,00,))JJ00''< ))JJ00'';D0-[;['- < EXTRACT(type FROM date)a<+ & )C;-[C)) & )C;-['@"L O+ 13/04/06 [email protected] 59 ADDDATE(date,INTERVAL expr type) ADDDATE(expr,days) SUBDATE(date,INTERVAL expr type) SUBDATE(expr,days) DATE_ADD(date,INTERVAL expr type) DATE_SUB(date,INTERVAL expr type) MICROSECOND MICROSECONDS SECOND_MICROSECOND 'SECONDS.MICROSECONDS' SECOND SECONDS MINUTE_MICROSECOND 'MINUTES.MICROSECONDS' MINUTE MINUTES MINUTE_SECOND 'MINUTES:SECONDS' HOUR HOURS HOUR_MICROSECOND 'HOURS.MICROSECONDS' DAY DAYS HOUR_SECOND 'HOURS:MINUTES:SECONDS' WEEK WEEKS HOUR_MINUTE 'HOURS:MINUTES' DAY_MICROSECOND 'DAYS.MICROSECONDS' MONTH MONTHS DAY_SECOND 'DAYS HOURS:MINUTES:SECONDS' QUARTER QUARTERS DAY_MINUTE 'DAYS HOURS:MINUTES' YEAR YEARS DAY_HOUR 'DAYS HOURS' YEAR_MONTH 'YEARS-MONTHS' 13/04/06 [email protected] 60

11 F$ H;./ F$ H;.:/ )0'15TT ADDTIME(expr,expr2)$ L9#L LL )C;- )C;-;D0-"L9L ;D0- DATEDIFF(expr,expr2) $ L&L9L L9 L )C;- )C;-;D0-')C;- (-;[ >0C;)C;-a;D0-a;D0-';C0?"<-@><a<@'C<a<bD'<a<D'<a <DB;->BC< H& & + +<& )C;-[ >0C; ';>[;[)C;- C';[)C4 $ >0[)C4'B $ : ;[)C4' $ :?->D)[C))?"B$ B #?& > & ?->D)[)D?T"?9?T?9?T?9 A& B U+?T?9 13/04/06 [email protected] 61 13/04/06 [email protected] 62 F$ H;.4/ F$ H;.5/ )C4 )C4 0B;J )C4BC0- $ )C4 0B;J $ T8T )C4 /--G <L$ TQ )"9Q"XQ' )C4 4-C> $ T8WW J@> <:98 0D>'-B)L µ: DB@;- :67 0B;J TT9 0B;JBC0-1@C>;-> T5 '-B) :67 13/04/06 [email protected] 63 /--Gc" d" <:6T : ):68. T : )T68. 8 T ): :68. W )T68.. X T68..T..T8$ 13/04/06 [email protected] 64 F$ H;.3/ 80IF@8.'/ /--G)C4 <L$ " :Q"TQ0"WQ) /--G 4-C> <T 68 4-C> <T::: C>/--Gc" d << < & L < & /--G ';>[;[)C;-"& <& )C;-[ >0C; 0CG-)C;-" & & )C;-# < $ 0CG-;D0- "" & ;D0- # DATE_FORMAT(date,format) TIME_FORMAT(time,format)& & <Z< a B $ "'' b B "b) c 0 "& +TT9 d b "& +::8T D b "&LT"9"8" e b "& +:8T f 0 ::::::777777ZJJ::98 h J:TT9 I J:TT9 i 0"& +::67 j b <::T8WW 13/04/06 [email protected] 65 13/04/06 [email protected] 66

12 8./ k J:98 l JTT9 m 0 "& +:TT9 M B b) p C0?0ZJ"& T9cC?d0 s ' ::67 S ' ::67Z;J"& 95 U B ::68" e)$ u B ::68" e$ V B :T68" e)$ "<ZI< v B :T68" e$ "<ZL< W B $ '' w B $ :Q'WQ' X C" + )"& +"5&"<ZK< x C" + "& +"5&"<Z< y C"& +"9& Y C"& +"5& 13/04/06 [email protected] 67 13/04/06 [email protected] 68,-.'/ ; T + L 9 SELECT x FROM t1 WHERE x=(select MAX(y) FROM t2) ; T+ +HL & SELECT * FROM t1 WHERE 2=(SELECT COUNT(x) FROM t1),-./ CREATE TABLE t1 (s1 INT,s2 CHAR(5),s3 FLOAT) INSERT INTO t1 VALUES (1,'1',1.0) INSERT INTO t1 VALUES (2,'2',2.0) SELECT sb1,sb2,sb3 FROM (SELECT s1 AS sb1,s2 AS sb2,s3*2 AS sb3 FROM t1) AS sb WHERE sb1>1 >2,'2',4.0 13/04/06 [email protected] 69 13/04/06 [email protected] 70,-817.'/,-817./ CB4 D ;>@- SELECT s1 FROM t1 WHERE s1 > ANY (SELECT s1 FROM t2) ' +<T+ _T:` <L ;>@-9 _9T"T5"X` 9+&#T: L C'-9 _9:"T:`" 9 _B@"B@" B@` 13/04/06 [email protected] 71 DBQCB4L + SELECT s1 FROM t1 WHERE s1 = ANY (SELECT s1 FROM t2) SELECT s1 FROM t1 WHERE s1 IN (SELECT s1 FROM t2) '0-CB4L + SELECT s1 FROM t1 WHERE s1 <> ANY (SELECT s1 FROM t2) SELECT s1 FROM t1 WHERE s1 <> SOME (SELECT s1 FROM t2) 13/04/06 [email protected] 72

13 ,-8"",-0?.'/ C < D ;>@- ;>@- ;@;-',+A SELECT s1 FROM t1 WHERE s1 > ALL (SELECT s1 FROM t2) ' +<T _T:` <L ;>@-9 _,6":"S6` 9 &#T: <L C'-9 _T9"W"B@",T::` 9++T: _:"B@"T` "9";>@- ',+A " -ID';'P+=;>@-"B;-ID';' P+= C'- 1 f SELECT DISTINCT store_type FROM Stores WHERE EXISTS (SELECT * FROM CitiesStores WHERE CitiesStores.storetype=Stores.storetype) 1<f SELECT DISTINCT storetype FROM Stores WHERE NOT EXISTS (SELECT * FROM CitiesStores WHERE CitiesStores.storetype=Stores.storetype) 13/04/06 [email protected] 73 13/04/06 [email protected] 74,-0?./ "6& 1 f -L,,+<' f SELECT DISTINCT storetype FROM Stores WHERE NOT EXISTS (SELECT * FROM Cities WHERE NOT EXISTS (SELECT * FROM CitiesStores WHERE CitiesStores.city=Cities.city AND CitiesStores.storetype=Stores.storetype )) ' ( $ 4 9 ' > < I ' ' : ; 13/04/06 [email protected] 75 13/04/06 [email protected] 76 "6& "0FC@1 SELECT nom,produit FROM users,commandes WHERE users.id=commandes.users_id SELECT nom,produit FROM users INNER JOIN commandes ON users.id=commandes.users_id > < ; > *A SELECT nom,produit FROM users LEFT JOIN commandes ON users.id=commandes.users_id > < ; 1"" 13/04/06 [email protected] 77 13/04/06 [email protected] 78

14 > A * SELECT nom,produit FROM users RIGHT JOIN commandes ON users.id=commandes.users_id > < ; SELECT UNION [ALL DISTINCT] SELECT [UNION [ALL +A '--; ' &UC" U '--; K U@BDBC@BDB )D';DB;A+A 13/04/06 [email protected] 79 13/04/06 [email protected] '/ INSERT [LOW_PRIORITY DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES ({expr DEFAULT},...),(...),... [ ON DUPLICATE KEY UPDATE col_name=expr,... ] INSERT [LOW_PRIORITY DELAYED] [IGNORE] [INTO] tbl_name SET col_name={expr DEFAULT},... [ ON DUPLICATE KEY UPDATE col_name=expr,... ] INSERT [LOW_PRIORITY DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT... INSERT INTO `test`.`t1` (a,b) VALUES(15,'toto') INSERT INTO `test`.`t2` (w,x,y,z) VALUES(NOW(),16,x*2,NULL) INSERT INTO t3 (a,b,c) VALUES ('tata',2,3),('l\'ile',5,6) INSERT INTO t3 (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1 13/04/06 [email protected] 81 13/04/06 [email protected] / <80 +ADB'->;'--;< < INSERT INTO t2 (id) SELECT t1.order_id FROM t1 WHERE t1.order_id>100; K U C@;[DB>-0-B;& C';[DB'->;[D) UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1 [,col_name2=expr2...] [WHERE conditions] [ORDER BY...] [LIMIT '-;+ # & # /J->-"& "& ##$ ' " #$ '>)->4& " #$ < & 13/04/06 [email protected] 83 13/04/06 [email protected] 84

15 06 UPDATE person SET age=12, prenom='titi' WHERE nom='toto' UPDATE person SET age=age+1 UPDATE log SET day=now() WHERE id=4 UPDATE items,month SET items.price=month.price WHERE items.id=month.id 13/04/ "00 DELETE [LOW_PRIORITY] [QUICK] [IGNORE] table_name[.*] [, table_name[.*]...] FROM table-references [WHERE conditions] DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM table_name[.*] [, table_name[.*]...] USING table-references [WHERE conditions] )--;-&[+ & L /J->-" <&' LU)--;-/J->-" & 13/04/06 [email protected] DELETE t1,t2 FROM t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id DELETE FROM t1,t2 USING t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id ' )--;->)->4+# " &< & -<+ +< D0D; DELETE FROM somelog WHERE user='jcole' ORDER BY dateinscr LIMIT "0 TRUNCATE TABLE tbl_name K*' C@;[DB>-0-B;L" # -L TRUNCATE TABLE test.t1 13/04/06 [email protected] 87 13/04/06 [email protected] 88 =@D.'/ SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [LIKE 'pattern'] SHOW CREATE DATABASE db_name SHOW CREATE TABLE tbl_name SHOW DATABASES [LIKE 'pattern'] SHOW [STORAGE] ENGINES SHOW ERRORS [LIMIT [offset,] row_count] SHOW GRANTS FOR user SHOW INDEX FROM tbl_name [FROM db_name] SHOW INNODB STATUS SHOW [BDB] LOGS =@D./ SHOW PRIVILEGES SHOW [FULL] PROCESSLIST SHOW STATUS [LIKE 'pattern'] SHOW TABLE STATUS [FROM db_name] [LIKE 'pattern'] SHOW [OPEN] TABLES [FROM db_name] [LIKE 'pattern'] SHOW [GLOBAL SESSION] VARIABLES [LIKE 'pattern'] SHOW WARNINGS [LIMIT [offset,] row_count] 13/04/06 [email protected] 89 13/04/06 [email protected] 90

16 H & CBC4g-;C- J-G;C- >-?CD>;C- >-';>-;C- H GD C)DB)-IDB;CJ- >-'-; 13/04/06 [email protected] 91 13/04/06 [email protected] 92 "#$ " " " bin/mysqld0'1 scripts/mysqld_safe scripts/mysql_install_db * bin/mysql " L '1"" bin/mysqlcc0'1 &+" L '1" bin/mysqladmin < bin/mysqlcheck & bin/mysqldump& bin/mysqlimport & bin/mysqlshow && * 0'1<+ & L+< & + U" $'()'*+"+",$ -'$".+""&#, O<*0'1&L -T&+ A # U " &++A+ U" & U & <L 13/04/06 [email protected] 93 13/04/06 [email protected] 94 "&, " 01I 0 [""&" "[" (>CB;>-KG- ' &U DB'->;"@?)C;-"" mysqladmin flush-privileges" mysqladmin reload 13/04/06 [email protected] 95 0'15:W '--;@>>-B;[@'-> CURRENT_USER() root@ row in set (0.02 sec) 13/04/06 [email protected] 96

17 0<8 81 SET PASSWORD FOR <<+ UPDATE mysql.user SET password=password('newpass') WHERE user='bob' AND host='.loc.gov' FLUSH PRIVILEGES GRANT priv_type [(column_list)] [, priv_type [(column_list)]]... ON {tbl_name * *.* db_name.*} TO user [IDENTIFIED BY [PASSWORD] 'password'] [, user [IDENTIFIED BY [PASSWORD] 'password']]... [REQUIRE NONE [{SSL X509}] [CIPHER cipher [AND]] [ISSUER issuer [AND]] [SUBJECT subject]] [WITH [GRANT OPTION MAX_QUERIES_PER_HOUR count MAX_UPDATES_PER_HOUR count MAX_CONNECTIONS_PER_HOUR count]] 13/04/06 [email protected] 97 13/04/06 [email protected] 98 0>@J0 ; +I.'/ REVOKE priv_type [(column_list)] [, priv_type [(column_list)]]... ON {tbl_name * *.* db_name.*} FROM user [, user]... -&DROP USER toto C+A)--;- DELETE FROM mysql.user WHERE user='toto' and host='localhost' FLUSH PRIVILEGES ALL [PRIVILEGES] ; &/D;J(>CB;?;DB ALTER C < C;->;C- CREATE C < >-C;-;C- CREATE TEMPORARY TABLES C < >-C;- ;-0?>C>4;C- DELETE C < )--;- DROP C < )>?;C- EXECUTE C <#L N 0'16: FILE C < '--;DB;@; D-C))C;C DB D- INDEX C < >-C;-DB)-I)>?DB)-I 13/04/06 [email protected] 99 13/04/06 [email protected] 100 ; +I./ ; +I.(/ INSERT C < DB'->; LOCK TABLES C < G;C-' +< '--; PROCESS C < REFERENCES > &>-C)C REPLICATION CLIENT ) #< e H REPLICATION SLAVE B +H SELECT C < '--; SHOW DATABASES SHOW DATABASES C& SHUTDOWN C < + SUPER C L +AL[ "<L JCB(-0C';->"GD "+"?@>(-0C';->(''-; (C UPDATE C USAGE ' YY < GRANT OPTION ' /D;J(>CB;?;DB 13/04/06 [email protected] /04/06 [email protected] 102

18 06.'/ 06./ GRANT ALL ON test.* TO GRANT ALL ON test.* TO GRANT DROP ON test TO GRANT ALL PRIVILEGES ON test.root_ TO IDENTIFIED BY 'goodsecret' REQUIRE SSL REVOKE DROP ON test FROM REVOKE ALL PRIVILEGES FROM 'toto' GRANT SHUTDOWN ON * TO 'root'@'localhost' IDENTIFIED BY 'goodsecret' REQUIRE ISSUER '/C=FI/ST=Some-State/L=Helsinki/O=MySQL Finland AB/CN=Tonu Samuel/ [email protected] GRANT ALL PRIVILEGES ON test.* TO 'root'@'localhost' IDENTIFIED BY 'goodsecret' REQUIRE SUBJECT '/C=EE/ST=Some-State/L=Tallinn/ O=MySQL demo client certificate/cn=tonu Samuel/ [email protected]' AND ISSUER '/C=FI/ST=Some-State/L=Helsinki/O=MySQL Finland AB/CN=Tonu Samuel/ [email protected]' AND CIPHER 'EDH-RSA-DES-CBC3-SHA' 13/04/06 [email protected] /04/06 [email protected] 104 ""1? " "1? bin < + data docs include lib scripts mysqld ) < A share/mysql < sql-bench ' bash# groupadd mysql bash# useradd -g mysql mysql bash# cd /usr/local bash# tar xvzf /path/to/mysql-version-os.tar.gz bash# ln -s full-path-to-mysql-version-os mysql bash# cd mysql bash# scripts/mysql_install_db bash# chown -R root. bash# chown -R mysql data bash# chgrp -R mysql. bash# bin/mysqld_safe --user=mysql & 13/04/06 [email protected] /04/06 [email protected] 106 K "D1@D + & $ & $L -?J?" C0?CS0'1S?J?S?0C IC0??CS0'1S?J?S?S?0C bin ' / " < &3+"+ data Docs mysqld ) examples? <L include lib scripts share < A < 13/04/06 [email protected] /04/06 [email protected] 108

19 + +$ " -/".$ & " & < " +D )) -/".$0&) 5:"D ) C 5:" -/".$0 / B;9:::I? -/".$0-1" + D )) -/".$0-10 +,L" 13/04/06 [email protected] 109 )&B;/ B;"9::: I?" && 0'1 < / / A0'1 +* <L <A C:\> C:\mysql\bin\mysqld --install C:\> C:\mysql\bin\mysqld --remove CA C:\> C:\mysql\bin\mysqladmin -u root shutdown CA0'1 C:\> NET STOP MySQL 13/04/06 [email protected] 110 & " 7 8 0'1 N"+ *& 0'1A, 04D'C0D'C0"0-0>4J-C?"0->(-")"DBB) + U" U+# 0'1-B(DB-;4?- >-C;-;C-. CREATE TABLE t (i INT) ENGINE=MYISAM; 04D'C0 D'C0& 0' D'C0 N & & " L +&& &2- N& <L N&<L 23 N& <L 23 13/04/06 [email protected] /04/06 [email protected] 112 0@ >4 J-C?L " N +0-0>4 #&+ & " L & + & - *"0'1" U <L& N"&& 0-0>4 *+ A 0->(- $ 0' D'C U0->(-"0'1L &+ &2- N& &24 + A 13/04/06 [email protected] /04/06 [email protected] 114

20 06 00 CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,message CHAR(20)); CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,message CHAR(20)); INSERT INTO t1 (message) VALUES ('table'),('t1'); INSERT INTO t2 (message) VALUES ('table'),('t2'); CREATE TABLE total (a INT NOT NULL AUTO_INCREMENT,message CHAR(20), INDEX(a)) ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST; SELECT * FROM total; a message table 3 t1 1 table 3 t )) N N) -))" L" U*#00D;>CG 13/04/06 [email protected] /04/06 [email protected] 116 $ 06 $ ' U <, + &" & ) "A ' U " & + U 00D; C" U >CG & K U ';C>; ;>CB'C;DB <, " '-;C@;00D;Q: L SET AUTOCOMMIT=0; C#" U00D; & + >CG & -L START TRANSACTION; FROM table1 WHERE type=1; UPDATE table2 SET summmary=@a WHERE type=1; COMMIT; 13/04/06 [email protected] /04/06 [email protected] 118 "6 F$;# 0L) < 0L) <* "'C?) 0L) NC0'1" N 6: 0L) L '1" + 0'16T 0L) & + 0'1<& h" "< # < 0'1 & &"+ + K U & * &" Ai+ + bash# cd mysql-data-directory bash# mv mysql.log mysql.old bash# mysqladmin flush-logs bash# cp mysql.old to-backup-directory bash# rm mysql.old 13/04/06 [email protected] /04/06 [email protected] 120

21 F$;#H F$;## &< & + ++A" & )0'15:T:" U& e+ N&<< --log-error[=file_name] '&[< "+ ("-2& ' U +# <+" U --log[=fichier] &< L +A& &L ("-$ +--log 13/04/06 [email protected] /04/06 [email protected] 122 F$;#& F$;#,- < & "+ # 0'1 6: & & '1 + & "& &" --log-bin[=file_name] +<< --log-slowqueries[=file_name]"+& +A'1+ long_query_time #<L ' &< "& & "&L-slow.log' & "+<+" & +A *<* <L +AA&< + L 13/04/06 [email protected] /04/06 [email protected] 124 * $ B CB'D,D',7:X6,L,T777 ) 0'1 L /04/06 [email protected] 125

2/3/04 Doc 7 SQL Part 1 slide # 1

2/3/04 Doc 7 SQL Part 1 slide # 1 2/3/04 Doc 7 SQL Part 1 slide # 1 CS 580 Client-Server Programming Spring Semester, 2004 Doc 7 SQL Part 1 Contents Database... 2 Types of Databases... 6 Relational, Object-Oriented Databases and SQL...

More information

Databases: MySQL Introduction

Databases: MySQL Introduction Databases: MySQL Introduction How to Use this User Guide This handbook accompanies the taught sessions for the course. Each section contains a brief overview of a topic for your reference and then one

More information

MS ACCESS DATABASE DATA TYPES

MS ACCESS DATABASE DATA TYPES MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,

More information

Database Administration with MySQL

Database Administration with MySQL Database Administration with MySQL Suitable For: Database administrators and system administrators who need to manage MySQL based services. Prerequisites: Practical knowledge of SQL Some knowledge of relational

More information

!"# $ %& '( ! %& $ ' &)* + ! * $, $ (, ( '! -,) (# www.mysql.org!./0 *&23. mysql> select * from from clienti;

!# $ %& '( ! %& $ ' &)* + ! * $, $ (, ( '! -,) (# www.mysql.org!./0 *&23. mysql> select * from from clienti; ! "# $ %& '(! %& $ ' &)* +! * $, $ (, ( '! -,) (# www.mysql.org!./0 *&23 mysql> select * from from clienti; " "!"# $!" 1 1 5#',! INTEGER [(N)] [UNSIGNED] $ - 6$ 17 8 17 79 $ - 6: 1 79 $.;0'

More information

sqlite driver manual

sqlite driver manual sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka [email protected] sqlite driver manual: A libdbi driver using the SQLite embedded database engine

More information

Database Migration from MySQL to RDM Server

Database Migration from MySQL to RDM Server MIGRATION GUIDE Database Migration from MySQL to RDM Server A Birdstep Technology, Inc. Raima Embedded Database Division Migration Guide Published: May, 2009 Author: Daigoro F. Toyama Senior Software Engineer

More information

Part 3. MySQL DBA I Exam

Part 3. MySQL DBA I Exam Part 3. MySQL DBA I Exam Table of Contents 23. MySQL Architecture... 3 24. Starting, Stopping, and Configuring MySQL... 6 25. Client Programs for DBA Work... 11 26. MySQL Administrator... 15 27. Character

More information

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems [email protected] Santa Clara, April 12, 2010

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems kai@sun.com Santa Clara, April 12, 2010 DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems [email protected] Santa Clara, April 12, 2010 Certification Details http://www.mysql.com/certification/ Registration at Conference Closed Book

More information

A table is a collection of related data entries and it consists of columns and rows.

A table is a collection of related data entries and it consists of columns and rows. CST 250 MySQL Notes (Source: www.w3schools.com) MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database objects called tables.

More information

Apache Cassandra Query Language (CQL)

Apache Cassandra Query Language (CQL) REFERENCE GUIDE - P.1 ALTER KEYSPACE ALTER TABLE ALTER TYPE ALTER USER ALTER ( KEYSPACE SCHEMA ) keyspace_name WITH REPLICATION = map ( WITH DURABLE_WRITES = ( true false )) AND ( DURABLE_WRITES = ( true

More information

Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query

Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query Objectives The objective of this lab is to learn the query language of SQL. Outcomes After completing this Lab,

More information

How To Create A Table In Sql 2.5.2.2 (Ahem)

How To Create A Table In Sql 2.5.2.2 (Ahem) Database Systems Unit 5 Database Implementation: SQL Data Definition Language Learning Goals In this unit you will learn how to transfer a logical data model into a physical database, how to extend or

More information

Linas Virbalas Continuent, Inc.

Linas Virbalas Continuent, Inc. Linas Virbalas Continuent, Inc. Heterogeneous Replication Replication between different types of DBMS / Introductions / What is Tungsten (the whole stack)? / A Word About MySQL Replication / Tungsten Replicator:

More information

Using SQL Server Management Studio

Using SQL Server Management Studio Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases

More information

MySQL 5.1 INTRODUCTION 5.2 TUTORIAL

MySQL 5.1 INTRODUCTION 5.2 TUTORIAL 5 MySQL 5.1 INTRODUCTION Many of the applications that a Web developer wants to use can be made easier by the use of a standardized database to store, organize, and access information. MySQL is an Open

More information

MySQL Security for Security Audits

MySQL Security for Security Audits MySQL Security for Security Audits Presented by, MySQL AB & O Reilly Media, Inc. Brian Miezejewski MySQL Principal Consultat Bio Leed Architect ZFour database 1986 Senior Principal Architect American Airlines

More information

New Features in MySQL 5.0, 5.1, and Beyond

New Features in MySQL 5.0, 5.1, and Beyond New Features in MySQL 5.0, 5.1, and Beyond Jim Winstead [email protected] Southern California Linux Expo February 2006 MySQL AB 5.0: GA on 19 October 2005 Expanded SQL standard support: Stored procedures

More information

New SQL Features in Firebird 3

New SQL Features in Firebird 3 New SQL Features in Firebird 3 Sponsors! Whats new in Firebird 3 Common SQL Full syntax of MERGE statement (per SQL 2008) MERGE... RETURNING Window (analytical) functions SUBSTRING with regular expressions

More information

MYSQL DATABASE ACCESS WITH PHP

MYSQL DATABASE ACCESS WITH PHP MYSQL DATABASE ACCESS WITH PHP Fall 2009 CSCI 2910 Server Side Web Programming Typical web application interaction Database Server 3 tiered architecture Security in this interaction is critical Web Server

More information

MySQL Command Syntax

MySQL Command Syntax Get It Done With MySQL 5&6, Chapter 6. Copyright Peter Brawley and Arthur Fuller 2015. All rights reserved. TOC Previous Next MySQL Command Syntax Structured Query Language MySQL and SQL MySQL Identifiers

More information

Testing and Verifying your MySQL Backup Strategy

Testing and Verifying your MySQL Backup Strategy About the Author Ronald BRADFORD Testing and Verifying your MySQL Backup Strategy Ronald Bradford http://ronaldbradford.com @RonaldBradford 16 years with MySQL / 26 years with RDBMS Senior Consultant at

More information

Guide to the Superbase. ODBC Driver. By Superbase Developers plc

Guide to the Superbase. ODBC Driver. By Superbase Developers plc Guide to the Superbase ODBC Driver By Superbase Developers plc This manual was produced using Doc-To-Help, by WexTech Systems, Inc. WexTech Systems, Inc. 310 Madison Avenue, Suite 905 New York, NY 10017

More information

CSC 443 Data Base Management Systems. Basic SQL

CSC 443 Data Base Management Systems. Basic SQL CSC 443 Data Base Management Systems Lecture 6 SQL As A Data Definition Language Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured

More information

Databases and SQL. The Bioinformatics Lab SS 2013 - Wiki topic 10. Tikira Temu. 04. June 2013

Databases and SQL. The Bioinformatics Lab SS 2013 - Wiki topic 10. Tikira Temu. 04. June 2013 Databases and SQL The Bioinformatics Lab SS 2013 - Wiki topic 10 Tikira Temu 04. June 2013 Outline 1 Database system (DBS) Definition DBS Definition DBMS Advantages of a DBMS Famous DBMS 2 Some facts about

More information

SQL: joins. Practices. Recap: the SQL Select Command. Recap: Tables for Plug-in Cars

SQL: joins. Practices. Recap: the SQL Select Command. Recap: Tables for Plug-in Cars Recap: the SQL Select Command SQL: joins SELECT [DISTINCT] sel_expression [, sel_expression ] FROM table_references [WHERE condition] [GROUPBY column [,column ] [[HAVING condition]] [ORDER BY columns [ASC

More information

Full Text Search in MySQL 5.1 New Features and HowTo

Full Text Search in MySQL 5.1 New Features and HowTo Full Text Search in MySQL 5.1 New Features and HowTo Alexander Rubin Senior Consultant, MySQL AB 1 Full Text search Natural and popular way to search for information Easy to use: enter key words and get

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database. Snippets Datenmanagement Version: 1.1.0 Study: 2. Semester, Bachelor in Business and Computer Science School: Hochschule Luzern - Wirtschaft Author: Janik von Rotz (http://janikvonrotz.ch) Source: https://gist.github.com/janikvonrotz/6e27788f662fcdbba3fb

More information

Information Systems SQL. Nikolaj Popov

Information Systems SQL. Nikolaj Popov Information Systems SQL Nikolaj Popov Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria [email protected] Outline SQL Table Creation Populating and Modifying

More information

Oracle Database 10g Express

Oracle Database 10g Express Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives

More information

MapInfo SpatialWare Version 4.6 for Microsoft SQL Server

MapInfo SpatialWare Version 4.6 for Microsoft SQL Server Release Notes MapInfo SpatialWare Version 4.6 for Microsoft SQL Server These release notes contain information about the SpatialWare v. 4.6 release. These notes are specific to the Microsoft SQL Server

More information

A basic create statement for a simple student table would look like the following.

A basic create statement for a simple student table would look like the following. Creating Tables A basic create statement for a simple student table would look like the following. create table Student (SID varchar(10), FirstName varchar(30), LastName varchar(30), EmailAddress varchar(30));

More information

B.1 Database Design and Definition

B.1 Database Design and Definition Appendix B Database Design B.1 Database Design and Definition Throughout the SQL chapter we connected to and queried the IMDB database. This database was set up by IMDB and available for us to use. But

More information

MySQL Backups: From strategy to Implementation

MySQL Backups: From strategy to Implementation MySQL Backups: From strategy to Implementation Mike Frank Senior Product Manager 1 Program Agenda Introduction The 5 Key Steps Advanced Options References 2 Backups are a DBAs Top Priority Be Prepared

More information

FileMaker 13. SQL Reference

FileMaker 13. SQL Reference FileMaker 13 SQL Reference 2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker, Inc. registered

More information

Database Security. Principle of Least Privilege. DBMS Security. IT420: Database Management and Organization. Database Security.

Database Security. Principle of Least Privilege. DBMS Security. IT420: Database Management and Organization. Database Security. Database Security Rights Enforced IT420: Database Management and Organization Database Security Textbook: Ch 9, pg 309-314 PHP and MySQL: Ch 9, pg 217-227 Database security - only authorized users can

More information

SQL Server An Overview

SQL Server An Overview SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system

More information

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA)

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA) 13 November 2007 22:30 Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA) By: http://www.alberton.info/firebird_sql_meta_info.html The SQL 2003 Standard introduced a new schema

More information

Mini User's Guide for SQL*Plus T. J. Teorey

Mini User's Guide for SQL*Plus T. J. Teorey Mini User's Guide for SQL*Plus T. J. Teorey Table of Contents Oracle/logging-in 1 Nested subqueries 5 SQL create table/naming rules 2 Complex functions 6 Update commands 3 Save a query/perm table 6 Select

More information

A Framework For Rapid Development Of OLTP Information Systems: Transformation Of SQL Statements To Three-Tier Web Applications

A Framework For Rapid Development Of OLTP Information Systems: Transformation Of SQL Statements To Three-Tier Web Applications A Framework For Rapid Development Of OLTP Information Systems: Transformation Of SQL Statements To Three-Tier Web Applications Teduh Dirgahayu Department of Informatics Indonesian Islamic University Yogyakarta,

More information

How, What, and Where of Data Warehouses for MySQL

How, What, and Where of Data Warehouses for MySQL How, What, and Where of Data Warehouses for MySQL Robert Hodges CEO, Continuent. Introducing Continuent The leading provider of clustering and replication for open source DBMS Our Product: Continuent Tungsten

More information

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

SQL - QUICK GUIDE. Allows users to access data in relational database management systems. http://www.tutorialspoint.com/sql/sql-quick-guide.htm SQL - QUICK GUIDE Copyright tutorialspoint.com What is SQL? SQL is Structured Query Language, which is a computer language for storing, manipulating

More information

LAMP Quickstart for Red Hat Enterprise Linux 4

LAMP Quickstart for Red Hat Enterprise Linux 4 LAMP Quickstart for Red Hat Enterprise Linux 4 Dave Jaffe Dell Enterprise Marketing December 2005 Introduction A very common way to build web applications with a database backend is called a LAMP Stack,

More information

The release notes provide details of enhancements and features in Cloudera ODBC Driver for Impala 2.5.30, as well as the version history.

The release notes provide details of enhancements and features in Cloudera ODBC Driver for Impala 2.5.30, as well as the version history. Cloudera ODBC Driver for Impala 2.5.30 The release notes provide details of enhancements and features in Cloudera ODBC Driver for Impala 2.5.30, as well as the version history. The following are highlights

More information

Firebird. Embedded SQL Guide for RM/Cobol

Firebird. Embedded SQL Guide for RM/Cobol Firebird Embedded SQL Guide for RM/Cobol Embedded SQL Guide for RM/Cobol 3 Table of Contents 1. Program Structure...6 1.1. General...6 1.2. Reading this Guide...6 1.3. Definition of Terms...6 1.4. Declaring

More information

2. Oracle SQL*PLUS. 60-539 Winter 2015. Some SQL Commands. To connect to a CS server, do:

2. Oracle SQL*PLUS. 60-539 Winter 2015. Some SQL Commands. To connect to a CS server, do: 60-539 Winter 2015 Some SQL Commands 1 Using SSH Secure Shell 3.2.9 to login to CS Systems Note that if you do not have ssh secure shell on your PC, you can download it from www.uwindsor.ca/softwaredepot.

More information

Best Practices in SQL Programming. Madhivanan

Best Practices in SQL Programming. Madhivanan Best Practices in SQL Programming Madhivanan Do not use irrelevant datatype VARCHAR instead of DATETIME CHAR(N) instead of VARCHAR(N) etc Do not use VARCHAR instead of DATETIME create table #employee_master(emp_id

More information

IT360: Applied Database Systems. Database Security. Kroenke: Ch 9, pg 309-314 PHP and MySQL: Ch 9, pg 217-227

IT360: Applied Database Systems. Database Security. Kroenke: Ch 9, pg 309-314 PHP and MySQL: Ch 9, pg 217-227 IT360: Applied Database Systems Database Security Kroenke: Ch 9, pg 309-314 PHP and MySQL: Ch 9, pg 217-227 1 Database Security Rights Enforced Database security - only authorized users can perform authorized

More information

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach TRAINING & REFERENCE murach's SQL Server 2012 for developers Bryan Syverson Joel Murach Mike Murach & Associates, Inc. 4340 N. Knoll Ave. Fresno, CA 93722 www.murach.com [email protected] Expanded

More information

4 Logical Design : RDM Schema Definition with SQL / DDL

4 Logical Design : RDM Schema Definition with SQL / DDL 4 Logical Design : RDM Schema Definition with SQL / DDL 4.1 SQL history and standards 4.2 SQL/DDL first steps 4.2.1 Basis Schema Definition using SQL / DDL 4.2.2 SQL Data types, domains, user defined types

More information

MySQL Storage Engines

MySQL Storage Engines MySQL Storage Engines Data in MySQL is stored in files (or memory) using a variety of different techniques. Each of these techniques employs different storage mechanisms, indexing facilities, locking levels

More information

MySQL. Pocket Reference

MySQL. Pocket Reference MySQL Pocket Reference SECOND EDITION MySQL Pocket Reference George Reese Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo MySQL Pocket Reference, Second Edition by George Reese Copyright

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database technology.

More information

Siemens Teamcenter Oracle -to-sql Server 2008 Migration Guide

Siemens Teamcenter Oracle -to-sql Server 2008 Migration Guide Siemens Teamcenter Oracle -to-sql Server 2008 Migration Guide Microsoft Corporation Published: June 2010 Author: Randy Dyess Solid Quality Mentors Technical Reviewers: Christopher Gill Teamcenter Centers

More information

CROSS REFERENCE. Cross Reference Index 110-122. Cast ID Number 110-111 Connector ID Number 111 Engine ID Number 112-122. 2015 Ford Motor Company 109

CROSS REFERENCE. Cross Reference Index 110-122. Cast ID Number 110-111 Connector ID Number 111 Engine ID Number 112-122. 2015 Ford Motor Company 109 CROSS REFERENCE Cross Reference Index 110-122 Cast ID Number 110-111 Connector ID Number 111 112-122 2015 Ford Motor Company 109 CROSS REFERENCE Cast ID Number Cast ID Ford Service # MC Part # Part Type

More information

ULTEO OPEN VIRTUAL DESKTOP V4.0

ULTEO OPEN VIRTUAL DESKTOP V4.0 ULTEO OPEN VIRTUAL DESKTOP V4.0 MIGRATION GUIDE 28 February 2014 Contents Section 1 Introduction... 4 Section 2 Overview... 5 Section 3 Preparation... 6 3.1 Enter Maintenance Mode... 6 3.2 Backup The OVD

More information

Introduction to SQL and database objects

Introduction to SQL and database objects Introduction to SQL and database objects IBM Information Management Cloud Computing Center of Competence IBM Canada Labs 1 2011 IBM Corporation Agenda Overview Database objects SQL introduction The SELECT

More information

Database access for illiterate programmers. K.B.Swiatlowski

Database access for illiterate programmers. K.B.Swiatlowski Database access for illiterate programmers K.B.Swiatlowski Abstract Writing an SQL statement can be difficult for people used to accessing data stored in flat files. Furthermore existing software code

More information

SQL - STRING FUNCTIONS

SQL - STRING FUNCTIONS SQL - STRING FUNCTIONS http://www.tutorialspoint.com/sql/sql-string-functions.htm Copyright tutorialspoint.com SQL string functions are used primarily for string manipulation. The following table details

More information

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to: D61830GC30 for Developers Summary Duration Vendor Audience 5 Days Oracle Database Administrators, Developers, Web Administrators Level Technology Professional Oracle 5.6 Delivery Method Instructor-led

More information

Erste Schritte mit mysql. Der Umgang mit einer relationalen Datenbank

Erste Schritte mit mysql. Der Umgang mit einer relationalen Datenbank Erste Schritte mit mysql Der Umgang mit einer relationalen Datenbank Relationale Datenbanken Prinzip: Daten sind in Tabellen gespeichert Tabellen können verknüpft sein alter Name: RDBMS - Relational Database

More information

Percona Server features for OpenStack and Trove Ops

Percona Server features for OpenStack and Trove Ops Percona Server features for OpenStack and Trove Ops George O. Lorch III Software Developer Percona Vipul Sabhaya Lead Software Engineer - HP Overview Discuss Percona Server features that will help operators

More information

TimesTen Auditing Using ttaudit.java

TimesTen Auditing Using ttaudit.java TimesTen Auditing Using ttaudit.java Installation, Operation, and Configuration As of: TimesTen 11.2.2.6 and ttaudit 1.0.0.15 March, 2014 The ttaudit.java application is free, open source project software

More information

SQL. Short introduction

SQL. Short introduction SQL Short introduction 1 Overview SQL, which stands for Structured Query Language, is used to communicate with a database. Through SQL one can create, manipulate, query and delete tables and contents.

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

More information

SVN Authentication and Authorization

SVN Authentication and Authorization Admin Guide SVN Authentication and Authorization Authentication and Authorization of SVN Users via Active Directory and OpenLDAP Gérard Bieli, Christian Haller Windisch, 14th August 2009 Contents 1 Prerequisites

More information

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement

More information

Language Reference Guide

Language Reference Guide Language Reference Guide InterBase XE April, 2011 Copyright 1994-2011 Embarcadero Technologies, Inc. Embarcadero Technologies, Inc. 100 California Street, 12th Floor San Francisco, CA 94111 U.S.A. All

More information

Partitioning under the hood in MySQL 5.5

Partitioning under the hood in MySQL 5.5 Partitioning under the hood in MySQL 5.5 Mattias Jonsson, Partitioning developer Mikael Ronström, Partitioning author Who are we? Mikael is a founder of the technology behind NDB

More information

Bidirectional replication for InterBase and Firebird

Bidirectional replication for InterBase and Firebird Bidirectional replication for InterBase and Firebird The open source database server, Firebird 1, and its commercial partner, Borland InterBase 2, have long been established as a proven and stable platform

More information

Microsoft SQL Server to Infobright Database Migration Guide

Microsoft SQL Server to Infobright Database Migration Guide Microsoft SQL Server to Infobright Database Migration Guide Infobright 47 Colborne Street, Suite 403 Toronto, Ontario M5E 1P8 Canada www.infobright.com www.infobright.org Approaches to Migrating Databases

More information

Database Query 1: SQL Basics

Database Query 1: SQL Basics Database Query 1: SQL Basics CIS 3730 Designing and Managing Data J.G. Zheng Fall 2010 1 Overview Using Structured Query Language (SQL) to get the data you want from relational databases Learning basic

More information

Backup/Restore MySQL Server

Backup/Restore MySQL Server This chapter will describe in details how to use Software to backup your MySQL server and how you can restore your MySQL server from the database backup files. Table of Content 1. Requirements 2. Overview

More information

Migrating from Sybase to SQL Server

Migrating from Sybase to SQL Server Migrating from to Table of Contents: Migrating from to Data Compatibility Mode Behavior Optimizer Hints Conclusion Migrating from to Projects involving database migration are common. In this article, we

More information

Physical File. Collection or Schema

Physical File. Collection or Schema ! "#$ %! iseries Library Physical File Record Field Logical File SQL Collection or Schema Table Row Column View or Index ! &! '!$ $ ()*++,, $,-.".".),-/ 0$1 234 5$ $,6 % '7 - -!# 8-9-,7-8 - %%.).-'-9 '!-

More information

PostgreSQL Audit Extension User Guide Version 1.0beta. Open Source PostgreSQL Audit Logging

PostgreSQL Audit Extension User Guide Version 1.0beta. Open Source PostgreSQL Audit Logging Version 1.0beta Open Source PostgreSQL Audit Logging TABLE OF CONTENTS Table of Contents 1 Introduction 2 2 Why pgaudit? 3 3 Usage Considerations 4 4 Installation 5 5 Settings 6 5.1 pgaudit.log............................................

More information

Boats bid bname color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red. Figure 1: Instances of Sailors, Boats and Reserves

Boats bid bname color 101 Interlake blue 102 Interlake red 103 Clipper green 104 Marine red. Figure 1: Instances of Sailors, Boats and Reserves Tutorial 5: SQL By Chaofa Gao Tables used in this note: Sailors(sid: integer, sname: string, rating: integer, age: real); Boats(bid: integer, bname: string, color: string); Reserves(sid: integer, bid:

More information

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added? DBMS Questions 1.) Which type of file is part of the Oracle database? A.) B.) C.) D.) Control file Password file Parameter files Archived log files 2.) Which statements are use to UNLOCK the user? A.)

More information

Structured Query Language (SQL)

Structured Query Language (SQL) Objectives of SQL Structured Query Language (SQL) o Ideally, database language should allow user to: create the database and relation structures; perform insertion, modification, deletion of data from

More information

Netezza SQL Class Outline

Netezza SQL Class Outline Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John

More information

Using the SQL Procedure

Using the SQL Procedure Using the SQL Procedure Kirk Paul Lafler Software Intelligence Corporation Abstract The SQL procedure follows most of the guidelines established by the American National Standards Institute (ANSI). In

More information

PassMark Software BurnInTest Management Console. Quick start guide

PassMark Software BurnInTest Management Console. Quick start guide PassMark Software BurnInTest Management Console Quick start guide Edition: 1.1 Date: 16 August 2013 BurnInTest Version: 7.1.1011+ BurnInTest is a trademark of PassMark software Overview For BurnInTest

More information

ODBC Client Driver Help. 2015 Kepware, Inc.

ODBC Client Driver Help. 2015 Kepware, Inc. 2015 Kepware, Inc. 2 Table of Contents Table of Contents 2 4 Overview 4 External Dependencies 4 Driver Setup 5 Data Source Settings 5 Data Source Setup 6 Data Source Access Methods 13 Fixed Table 14 Table

More information

CSI 2132 Lab 3. Outline 09/02/2012. More on SQL. Destroying and Altering Relations. Exercise: DROP TABLE ALTER TABLE SELECT

CSI 2132 Lab 3. Outline 09/02/2012. More on SQL. Destroying and Altering Relations. Exercise: DROP TABLE ALTER TABLE SELECT CSI 2132 Lab 3 More on SQL 1 Outline Destroying and Altering Relations DROP TABLE ALTER TABLE SELECT Exercise: Inserting more data into previous tables Single-table queries Multiple-table queries 2 1 Destroying

More information

6 CHAPTER. Relational Database Management Systems and SQL Chapter Objectives In this chapter you will learn the following:

6 CHAPTER. Relational Database Management Systems and SQL Chapter Objectives In this chapter you will learn the following: 6 CHAPTER Relational Database Management Systems and SQL Chapter Objectives In this chapter you will learn the following: The history of relational database systems and SQL How the three-level architecture

More information

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases. SQL Databases Course by Applied Technology Research Center. 23 September 2015 This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases. Oracle Topics This Oracle Database: SQL

More information

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 ERserver iseries DB2 Universal Database for iseries SQL Programming with Host Languages Version 5 Copyright

More information

Visa Smart Debit/Credit Certificate Authority Public Keys

Visa Smart Debit/Credit Certificate Authority Public Keys CHIP AND NEW TECHNOLOGIES Visa Smart Debit/Credit Certificate Authority Public Keys Overview The EMV standard calls for the use of Public Key technology for offline authentication, for aspects of online

More information

Create a Database Driven Application

Create a Database Driven Application Create a Database Driven Application Prerequisites: You will need a Bluemix account and an IBM DevOps Services account to complete this project. Please review the Registration sushi card for these steps.

More information

Acceptance Page 2. Revision History 3. Introduction 14. Control Categories 15. Scope 15. General Requirements 15

Acceptance Page 2. Revision History 3. Introduction 14. Control Categories 15. Scope 15. General Requirements 15 Acceptance Page 2 Revision History 3 Introduction 14 Control Categories 15 Scope 15 General Requirements 15 Control Category: 0.0 Information Security Management Program 17 Objective Name: 0.01 Information

More information

Refresh Web Query Synonym

Refresh Web Query Synonym 1 Added to CRTWQSYN command. Available in 1.1.2 HotFix 5 Use to synchronize Web Query synonym when structure/format of underlying table changes. Can be called from command line, CL program, Job Scheduler.

More information

Victims Compensation Claim Status of All Pending Claims and Claims Decided Within the Last Three Years

Victims Compensation Claim Status of All Pending Claims and Claims Decided Within the Last Three Years Claim#:021914-174 Initials: J.T. Last4SSN: 6996 DOB: 5/3/1970 Crime Date: 4/30/2013 Status: Claim is currently under review. Decision expected within 7 days Claim#:041715-334 Initials: M.S. Last4SSN: 2957

More information

CSCI110 Exercise 4: Database - MySQL

CSCI110 Exercise 4: Database - MySQL CSCI110 Exercise 4: Database - MySQL The exercise This exercise is to be completed in the laboratory and your completed work is to be shown to the laboratory tutor. The work should be done in week-8 but

More information

Introduction to the Oracle DBMS

Introduction to the Oracle DBMS Introduction to the Oracle DBMS Kristian Torp Department of Computer Science Aalborg University www.cs.aau.dk/ torp [email protected] December 2, 2011 daisy.aau.dk Kristian Torp (Aalborg University) Introduction

More information

Distributed Database Guide Version: 00.01

Distributed Database Guide Version: 00.01 Distributed Database Guide Version: 00.01 Document No: 42/DBM42-T04192006-01-DDB Author: DBMaker Support Team Apr 19, 2006 LingAn Computer Engineering CO. Print Date: Apr 29, 2006 Introduction Table of

More information

Structured Query Language. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Structured Query Language. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics Structured Query Language HANS- PETTER HALVORSEN, 2014.03.03 Faculty of Technology, Postboks 203,

More information