SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having...
-
Upload
cecil-armstrong -
Category
Documents
-
view
231 -
download
0
Transcript of SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having...
![Page 1: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/1.jpg)
SQL ORACLE
1
![Page 2: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/2.jpg)
Data Type
2
![Page 3: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/3.jpg)
3
![Page 4: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/4.jpg)
VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2.BYTE indicates that the column will have byte length semantics. CHAR indicates that the column will have character semanticsCHAR [(size [BYTE | CHAR])] Fixed-length character data of length size bytes or characters. Maximum size is 2000 bytes or characters. Default and minimum size is 1 byte.
4
![Page 5: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/5.jpg)
NUMBER [ (p [, s]) ] Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127. Both precision and scale are in decimal digits. A NUMBER value requires from 1 to 22 bytes.
5
![Page 6: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/6.jpg)
LONG Character data of variable length up to 2 gigabytes, or 231 -1 bytes. Provided for backward compatibility.RAW(size) Raw binary data of length size bytes. Maximum size is 2000 bytes. You must specify size for a RAW value.
6
![Page 7: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/7.jpg)
DATE Valid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by the NLS_DATE_FORMAT parameter or implicitly by the NLS_TERRITORY parameter. The size is fixed at 7 bytes. This data type contains the date time fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It does not have fractional seconds or a time zone.
7
![Page 8: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/8.jpg)
8
![Page 9: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/9.jpg)
9
![Page 10: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/10.jpg)
Key structure
• SELECT select_list[ INTO new_table ] FROM table_source [ WHERE search_condition ] [ GROUP BY group_by_expression ] [ HAVING search_condition ] [ ORDER BY order_expression [ ASC | DESC ] ]
10
![Page 11: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/11.jpg)
Grammar• SELECT statement ::=
< query_expression > [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } [ ,...n ] ] [ COMPUTE { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] [ BY expression [ ,...n ] ] ] [ FOR { BROWSE | XML { RAW | AUTO | EXPLICIT } [ , XMLDATA ] [ , ELEMENTS ] [ , BINARY base64 ] } ] [ OPTION ( < query_hint > [ ,...n ]) ]
11
![Page 12: SQL ORACLE 1. Data Type 2 3 VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size.](https://reader034.fdocuments.in/reader034/viewer/2022052308/56649f455503460f94c67a5a/html5/thumbnails/12.jpg)
Grammar-cont.• < query expression > ::=
{ < query specification > | ( < query expression > ) } [ UNION [ ALL ] < query specification | ( < query expression > ) [...n ] ]
• < query specification > ::= SELECT [ ALL | DISTINCT ] [ { TOP integer | TOP integer PERCENT } [ WITH TIES ] ] < select_list > [ INTO new_table ] [ FROM { < table_source > } [ ,...n ] ] [ WHERE < search_condition > ] [ GROUP BY [ ALL ] group_by_expression [ ,...n ] [ WITH { CUBE | ROLLUP } ] ] [HAVING <search_condition>]
12