Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

1.The SQL introuduction

Introducing Oracle Database 11g
List the features of Oracle Database 11g
Discuss the basic design, theoretical and physical aspects of a relational database
Categorize the different types of SQL statements
Describe the data set used by the course
Log onto the database using the SQL Developer environment
Save queries to files and use script files in SQL Developer
Retrieving Data Using the SQL SELECT Statement
List the capabilities of SQL SELECT statements
Generate a report of data from the output of a basic SELECT statement
Select All Columns
Select Specific Columns
Use Column Heading Defaults
Use Arithmetic Operators
Understand Operator Precedence
Learn the DESCRIBE command to display the table structure
Restricting and Sorting Data
Write queries that contain a WHERE clause to limit the output retrieved
List the comparison operators and logical operators that are used in a WHERE clause
Describe the rules of precedence for comparison and logical operators
Use character string literals in the WHERE clause
Write queries that contain an ORDER BY clause sort the output of a SELECT statement
Sort output in descending and ascending order
Using Single-Row Functions to Customize Output
Describe the differences between single row and multiple row functions
Manipulate strings with character function in the SELECT and WHERE clauses
Manipulate numbers with the ROUND, TRUNC and MOD functions
Perform arithmetic with date data
Manipulate dates with the date functions
Using Conversion Functions and Conditional Expressions
Describe implicit and explicit data type conversion
Use the TO_CHAR, TO_NUMBER, and TO_DATE conversion functions
Nest multiple functions
Apply the NVL, NULLIF, and COALESCE functions to data
Use conditional IF THEN ELSE logic in a SELECT statement
Reporting Aggregated Data Using the Group Functions
Use the aggregation functions in SELECT statements to produce meaningful reports
Create queries that


Ïà¹ØÎĵµ£º

ÔÚSQL ServerÀï²é¿´µ±Ç°Á¬½ÓµÄÔÚÏßÓû§Êý

 ÔÚSQL ServerÀï²é¿´µ±Ç°Á¬½ÓµÄÔÚÏßÓû§Êý
use master
select loginame,count(0) from sysprocesses
group by loginame
order by count(0) desc
select nt_username,count(0) from sysprocesses
group by nt_username
order by count(0) desc
Èç¹ûij¸öSQL ServerÓû§ÃûtestÁ¬½Ó±È½Ï¶à,²é¿´ËüÀ´×ÔµÄÖ÷»úÃû:
......

SQL ÅжÏÉí·ÝÖ¤ºÅÂë

ÏÖÒªÇó²éѯ½çÃ棺²»ÂÛ15λ»òÕß18λÉí·ÝÖ¤ºÅ¶¼Äܲéѯ³öÊý¾Ý¿âÖÐËùÓе±Ç°Óû§ÐÅÏ¢¡£
·½°¸1£º
create or replace function CONVERT_ID_15 (/*ת»»Éí·ÝÖ¤ºÅΪ15λ*/
  p_id2 in varchar2
) return varchar2
is
  p_id varchar2(20);
  id varchar2(15);
begin
  p_id:=ltrim(p_id2);
  p_id ......

SQL ServerÖеÄCTE

 1¡¢¹«Óñí±í´ïʽ (CTE) ¿ÉÒÔÈÏΪÊÇÔÚµ¥¸ö SELECT¡¢INSERT¡¢UPDATE¡¢DELETE »ò CREATE VIEW Óï¾äµÄÖ´Ðз¶Î§ÄÚ¶¨ÒåµÄÁÙʱ½á¹û¼¯¡£CTE ÓëÅÉÉú±íÀàËÆ£¬¾ßÌå±íÏÖÔÚ²»´æ´¢Îª¶ÔÏ󣬲¢ÇÒÖ»ÔÚ²éѯÆÚ¼äÓÐЧ¡£ÓëÅÉÉú±íµÄ²»Í¬Ö®´¦ÔÚÓÚ£¬CTE ¿É×ÔÒýÓ㬻¹¿ÉÔÚͬһ²éѯÖÐÒýÓöà´Î¡£
¡¡¡¡CTE ¿ÉÓÃÓÚ£º
¡¡¡¡´´½¨µÝ¹é²éѯ¡£ÓйØÏêϸР......

»ùÓÚSQL Server ·ÖÒ³´æ´¢¹ý³ÌµÄÑݽø

 
»ùÓÚSQL Server ·ÖÒ³´æ´¢¹ý³ÌµÄÑݽø ÊÕ²Ø
Õë¶ÔÊý¾Ý¿âÊý¾ÝÔÚUI½çÃæÉϵķÖÒ³ÊÇÀÏÉú³£Ì¸µÄÎÊÌâÁË£¬ÍøÉϺÜÈÝÒ×ÕÒµ½¸÷Ö֓ͨÓô洢¹ý³Ì”´úÂ룬¶øÇÒÓÐЩ»¹¶¨ÖƲéѯÌõ¼þ£¬¿´ÉÏȥʹÓúܷ½±ã¡£±ÊÕß´òËãͨ¹ý±¾ÎÄÒ²À´¼òµ¥Ì¸Ò»Ï»ùÓÚSQL SERVER 2000µÄ·ÖÒ³´æ´¢¹ý³Ì£¬Í¬Ê±Ì¸Ì¸SQL SERVER 2005Ï·ÖÒ³´æ´¢¹ý³ÌµÄÑ ......

SQLÈÕÆÚºÍʱ¼äº¯Êý

 
--»ùÓÚʱ¼äSQLº¯Êý--
getdate() --·µ»Øµ±Ç°ÏµÍ³ÈÕÆÚºÍʱ¼ä¡£
DateAdd --ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ¡£
DATEADD ( datepart , number, date )
--Àý£ºÏòµ±ÌìµÄʱ¼äÔö¼Ó5Ìì
select dateadd(dd,5,getdate())
datediff --·µ»Ø¿çÁ½¸öÖ¸¶¨ÈÕÆÚµÄÈÕÆÚºÍʱ¼ä±ß½çÊý¡£]
---ÀýÈç
 & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ