Home
Search results “Oracle sql value not numeric”
About that error: ORA-06502: numeric or value error
 
12:11
"ORA-06502: numeric or value error" is one of the most commonly occurring and irritating errors for PL/SQL developers. Value too big for its "container"? Trying to stuff a non-numeric string value into a number through implicit conversion? [naughty naughty] In this video, Steven takes a close look at ORA-06502, exploring the ways it can be raised and how best to deal with those scenarios. ============================ Practically Perfect PL/SQL with Steven Feuerstein Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Oracle SQL Tutorial 33 - NUMBER Data Type
 
07:18
This video we are going to discuss the NUMBER data type. The Number data type is used to store integers, and real numbers. When you create a column as a NUMBER, you can store pretty huge or pretty small numbers in this column. Now there are two things you need to consider when working with numbers, and that is the precision as well as the how big the number is. For example, we can store the number 9.9. This has two significant digits. We could also store the number 9.9 X 10^4. In this situation, the number is much larger, but the number of significant digits is the same. 9.9 are the significant digits. When we expand this out we just have 99000, and the zeros are just used for size and are not considered "significant" in this situation. In fact, you get a max precision of 38, but a maximum value of 9.99 * 10^125. You can also use this data type to store very small numbers. Check the docs for the specifics on maximums and minimums. You can provide it with two pieces of information: Precision - The total number of digits. Scale - The number of digits to the right of the decimal. You do it in this format: NUMBER (precision, scale). The important thing to remember in this is that when you specify a precision, you will be limiting the max size of the numbers. The secret behind this data type is that it is actually stored in scientific notation. That is we store a number and then we can multiply it by 10 raised to some power. This allows us to store much larger numbers without taking up a ton of space. The oracle docs actually gives a formula that you can use to see how much storage is going to be required for a specific NUMBER data type. How much precision can be used? The acceptable range is 1-38. What about scale? The range is actually -84 to 127. I'll explain the scale in more detail in an upcoming video. That's because there is a lot of confusing things here…What does it mean for the scale to be negative? How can we have a scale that is bigger that the total number of digits available through the precision. That's a topic for another video. It's important to understand that when we increase our scale, we decrease the max size of the number. For example if we have a precision of 5 and a scale of 3, the highest number we can store is 99.999. This is in contrast to a precision of 5 and a scale of 2 which allows for up to 99.999. Either way you get 5 significant digits, but the numbers of digits to the left and right of the decimal change. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 6854 Caleb Curry
COALESCE IN ORACLE SQL
 
06:50
This video is the 4th video in the series of 'working with null', this video explains the working of the coalesce function in oracle sql. Also the video explains the use of coalesce function in oracle sql queries by perfect simple and easy to understand examples. COALESCE returns the first non-null expr in the expression list. You must specify at least two expressions. If all occurrences of expr evaluate to null, then the function returns null. Oracle Database uses short-circuit evaluation. The database evaluates each expr value and determines whether it is NULL, rather than evaluating all of the expr values before determining whether any of them is NULL. If all occurrences of expr are numeric datatype or any non numeric datatype that can be implicitly converted to a numeric datatype, then Oracle Database determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype.
Views: 930 Kishan Mashru
SQL Tutorial - 33: ABS() Function
 
04:39
In this tutorial we'll check out the ABS() function that returns the absolute value of a number.
Views: 27243 The Bad Tutorials
LNNVL FUNCTION IN ORACLE SQL
 
09:11
This video is the 5th video in the series of 'working with null', this video explains the working of the lnnvl function in oracle sql with simple and easy to understand example. LNNVL provides a concise way to evaluate a condition when one or both operands of the condition may be null. The function can be used only in the WHERE clause of a query. It takes as an argument a condition and returns TRUE if the condition is FALSE or UNKNOWN and FALSE if the condition is TRUE. LNNVL can be used anywhere a scalar expression can appear, even in contexts where the IS [NOT] NULL, AND, or OR conditions are not valid but would otherwise be required to account for potential nulls. Oracle Database sometimes uses the LNNVL function internally in this way to rewrite NOT IN conditions as NOT EXISTS conditions. In such cases, output from EXPLAIN PLAN shows this operation in the plan table output. The condition can evaluate any scalar values but cannot be a compound condition containing AND, OR, or BETWEEN.
Views: 565 Kishan Mashru
Oracle SQL PLSQL 12C Tutorial 19 - Default Value
 
04:32
This Video Tutorial Will Describe how to set the default value of the column. This command will also work on other versions of database like Oracle 11g Database, Oracle 10g Database, Oracle 9i Database, Oracle 8i Database, Oracle 8 Database and so on. DEFAULT clause is used to set the value for the table column. DEFAULT clause insert the predefined value into the column if you left it blank while inserting the column. Full Syntax will be given in this video tutorial about how to use the DEFAULT clause. Along with live example to demonstrate DEFAULT clause. All the keywords, format, mandatory clauses etc are described in this video.
SQL with Oracle 10g XE - Using the COUNT and SUM Functions
 
04:09
In this video I use the COUNT and SUM functions available to the SQL language. I used the COUNT function to add up the number of records in my query. This function works well with all data types and will just count the number or records that result from the conditions of your query. The SUM function will add up the numeric values and produce a total amount of a column. When using a function be sure to use parenthesis around the column you are performing the function on. This video is part of a series of videos with the purpose of learning the SQL language. For more information visit Lecture Snippets at http://lecturesnippets.com.
Views: 7601 Lecture Snippets
Oracle SQL PLSQL 12C Tutorial 17 - Computation / Functions Part 1
 
24:15
This video describes the various computation methods that can be done on table data and values. This includes arithmetic operators, renaming columns, logical operators, NOT operator, range searching, pattern matching, Oracle functions, string functions, numeric functions, a conversion function, date function. It includes the following functions that include, AVG, MIN, COUNT, BETWEEN, AND, OR, NOT, NOT IN, LIKE ETC. All the commands explained with syntax and example.
Oracle SQL Tutorial 24 - Important Data Types
 
06:09
In the upcoming videos we are going to discuss data types in depth, but I don't want to drown you in all of the details. Because of that, I'm giving you this video which is going to introduce you to the most important data types. Then, in the upcoming videos, I'll describe them in more depth. One of the data types we've already discussed in this video is NUMBER. This data type is used to, obviously, store a number. It can be used to store integers (whole numbers), or numbers with decimals. There are two other numeric data types you should know of. BINARY_FLOAT and BINARY_DOUBLE are both numeric data types that are known as floating point numbers. A floating point number is often used for large numbers that have decimal places where it is acceptable to not be completely precise. What I mean by this is that these numbers can only store numbers correctly up to a certain decimal point. If you need perfect precision, you will want to use the NUMBER data type. Now storing numbers is good sometimes, but occasionally you will want to store string data. String data can be any sequence of characters, including numbers. By telling the database that a column is a string data type, the database knows how to treat that column. There are four important string data types that you need to know about. The first two are CHAR and NCHAR. These data types are used to store a fixed-length string. So for example, you can say you want to store 12 characters. This means that every value for this column will be exactly 12 characters. If you insert less than 12 characters, the data will be padded with spaces. This means you will want to use one of these data types when every value in the column is the same length. What is the difference between CHAR and NCHAR? CHAR uses what is known as ASCII while NCHAR uses Unicode. The difference is what characters are allowed and how much space each character takes. ASCII takes up less space but only supports English, numbers, and some symbols. UNICODE allows you to store characters from multiple languages but takes up more space. Those were both fixed-length string. What if you want to store data that changes in length? That is where VARCHAR2 and NVARCHAR2 come in. When it comes to storing dates, the data types that are most important are DATE and TIMESTAMP. Date can be used to store dates and time. Timestamp is a data type that can be used to store an exact moment in time. Lastly, there are interval types. These store a date range. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 5477 Caleb Curry
Part 7   SQL query to find rows that contain only numerical data
 
01:50
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/06/part-7-sql-query-to-find-rows-that_13.html Let me explain the scenario mentioned in one of the sql server interview. We have the following table. ID Value 1 123 2 ABC 3 DEF 4 901 5 JKL Write a SQL query to retrieve rows that contain only numerical data. SQL Script to create the TestTable Create Table TestTable ( ID int identity primary key, Value nvarchar(50) ) Insert into TestTable values ('123') Insert into TestTable values ('ABC') Insert into TestTable values ('DEF') Insert into TestTable values ('901') Insert into TestTable values ('JKL') This is very easy to achieve. If you have used ISNUMERIC() function in SQL Server, then you already know the answer. Here is the query SELECT Value FROM TestTable WHERE ISNUMERIC(Value) = 1 ISNUMERIC function returns 1 when the input expression evaluates to a valid numeric data type, otherwise it returns 0. For the list of all valid numeric data types in SQL Server please visit the following MSDN link. http://technet.microsoft.com/en-us/library/ms186272(v=sql.110).aspx
Views: 90291 kudvenkat
Oracle LPAD Function
 
04:27
https://www.databasestar.com/oracle-lpad/ The Oracle LPAD function is used to add extra characters to the left of a text value. This is called “padding”, and the function is called LPAD because the L stands for “left” and it “left pads” a text value. It’s the opposite of RPAD, which pads characters to the right of the value. The LPAD function can be useful for ensuring all values are the same length, or if there is another requirement you have for adding characters to the end. The syntax is: LPAD(expr, length [,pad_expression]) The expr parameter is the text value you want to pad or add characters to. The length is the total length the expression or value will be after the padding has been done. It’s not the number of characters to add. The pad_expression is an optional field and is the character or characters to add to the left end of the string. The default value is a space. If the length specified in the function is shorter than the length of the string, then the string is truncated to meet the length. For more information about the Oracle LPAD (and LPAD) function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-lpad/
Views: 538 Database Star
Oracle SQL Lecture 30:  Arithmetic Operators
 
02:43
Arithmetic Operators https://www.youtube.com/channel/UCnBpiBIOtRgMsk4G7Ri1jbQ
Views: 596 Oracle SQL
Non-numeric value FIX (build an online shop with Codeigniter)
 
02:02
A quick video for anyone who is going a 'non-numeric value' error, when they try to add to basket.
Views: 1125 David Connelly
Oracle SQL PLSQL 12C Tutorial 22 - Computation / Functions Part 3
 
11:29
This video describes the various computation methods that can be done on table data and values. This includes arithmetic operators, renaming columns, logical operators, NOT operator, range searching, pattern matching, Oracle functions, string functions, numeric functions, a conversion function, date function. It includes the following functions that include TO_NUMBER, TO_CHAR, TO_DATE, ADD_MONTHS, LAST_DAY, MONTHS_BETWEEN, NEXT_DAY ETC. All the commands explained with syntax and example. Gymnopedie No 3 by Kevin MacLeod is licensed under a Creative Commons Attribution license (https://creativecommons.org/licenses/by/4.0/) Source: http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100785 Artist: http://incompetech.com/
SQL Tutorial - 23: The LIKE Operator and Wildcard Characters
 
07:36
In this tutorial we'll check out a few examples of the LIKE Operator along with the wildcard characters (% and _).
Views: 59071 The Bad Tutorials
SQL,  Oracle 4e67,  Why store numeric data as characters
 
04:27
Why store numeric data as characters in SQL.
Views: 370 hammadshams
MySQL 31 - DECIMAL Data Type
 
02:20
The DECIMAL data type is similar to the INT data type in that when you use the number for math, it maintains precision. The difference though is obvious in the name. The DECIMAL data type allows for numbers after a decimal point (and before the decimal point). The DECIMAL data type allows us to store what is known as a fixed-point number. A fixed point number is a number that has a specific number of digits available to store numbers in. That means we can't do things like use a DECIMAL data type to store as many digits of PI as possible, because we can't store unlimited digits. We are limited to a certain number. There are two keywords you need to understand when you are working with the DECIMAL data type, precision and scale. Precision is the number of digits and scale is the number of those digits that will come after the radix. You are going to want to provide these numbers when you declare a column of this data type. For example, DECIMAL(5, 2) has a precision of 5 digits and a scale of 2 digits. That means we can store a maximum of two digits after the decimal and four digits total. This gives us a possible range from -999.99 to 999.99 The highest number of digits is 65, and the highest number of digits after the decimal is 30. This data type is also known as DEC, NUMERIC, and FIXED. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 6336 Caleb Curry
PHPでWarning: A non numeric value encountered inを直す方法
 
09:09
ショッピングカートのシステムを自作しています。 数値でない文字列を使って演算を行う際にどうやらPHP7.1からWarningが出てしまうようです。 エラーコードが吐き出されたら、まずググれ。 ハマり時間、約1時間半でした・・。 http://9-4.jp/
Views: 572 吉田ゆうすけ
Sequence in SQL Server Tamil
 
07:13
Click here to Subscribe to IT PORT Channel : https://www.youtube.com/channel/UCMjmoppveJ3mwspLKXYbVlg A sequence is a user-defined schema bound object that generates a sequence of numeric values according to the specification with which the sequence was created. The sequence of numeric values is generated in an ascending or descending order at a defined interval and can be configured to restart (cycle) when exhausted. Sequences, unlike identity columns, are not associated with specific tables. Applications refer to a sequence object to retrieve its next value. The relationship between sequences and tables is controlled by the application. User applications can reference a sequence object and coordinate the values across multiple rows and tables.
Views: 253 IT Port
Oracle SQL Tutorial 30 - UTF-8 and UTF-16 Character Sets
 
04:01
A few videos ago we discussed UTF-8 and UTF-16 encoding, but when we are working with a database we do not worry about encodings as much as we do character sets. That's because a specific character set is going to have a specific encoding. The reason I am making this video is to introduce you to the most common character sets and to teach you the differences. That’s because as we go into the national character sets we need to understand the information taught in this video. So the first character set I am going to teach you about is AL32UTF8. AL32UTF8 is a character set that uses the uff-8 encoding and each character can take up to 4 bytes with the utf-8 encoding. There is another character set (not encoding) called utf8 (no hyphen) which is also encoded with UTF-8. This can be a little confusing because UTF8 is the name of an encoding and a character set, but bear with me. Both of these character sets are UTF-8 encoded, but UTF8 uses an older version of UTF-8 encoding. Generally, they work about the same, but the way certain characters are stored is slightly different, specifically way certain characters are stored is slightly different, specifically what are known as supplementary characters, which take up 4 bytes. The max size for a UTF8 character set is 3 bytes, as they do not directly support the supplementary characters as 4 bytes but instead store them across 2 groups of 3 bytes each. Oracle recommends that you use AL32UTF8 for all future development instead of the archaic UTF8 character set. There is another character set that you should know about, and that is AL16UTF16, which uses the UTF-16 encoding. Watch my video over UTF-8 and UTF-16 to learn more about UTF-16. Lastly, there is a character set known as UTFE, which uses an encoding known as UTF-EBCDIC. This is like a super archaic character set, and I'm not even going to talk about it. I thought I would at least mention it as it is going to come up a bit in the next video's topic. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 5866 Caleb Curry
COALESCE Function in SQL ORACLE Query With Example
 
03:53
ORACLE/PLSQL: COALESCE FUNCTION The Oracle/PLSQL COALESCE function returns the first non-null expression in the list. If all expressions evaluate to null, then the COALESCE function will return null. The syntax for the Oracle/PLSQL COALESCE function is: coalesce( expr1, expr2, ... expr_n ) PARAMETERS: expr1 to expr_n are the expressions to test for non-null values. EXAMPLE: The COALESCE function can be used in Oracle/PLSQL. You could use the coalesce function in a SQL statement as follows: SELECT COALESCE( address1, address2, address3 ) result FROM suppliers; The above COALESCE function is equivalent to the following IF-THEN-ELSE statement: IF address1 is not null THEN result := address1; ELSIF address2 is not null THEN result := address2; ELSIF address3 is not null THEN result := address3; ELSE result := null; END IF; The COALESCE function will compare each value, one by one. Lets apply the same to emp table. We have some NULL values in comm and mgr columns. but not in any other columns. So lets take a example for this 2 columns. COALESCE(comm,mgr,sal) Here if comm is null, function returns mgr value. If mgr is null it returns sal value! Query used in video: SELECT ename,comm,mgr,sal,COALESCE(comm,mgr,sal) result FROM emp;
Views: 6198 WingsOfTechnology
Oracle SQL PLSQL 12C Tutorial 18 - Computation / Functions Part 2
 
08:38
This video describes the various computation methods that can be done on table data and values. This includes arithmetic operators, renaming columns, logical operators, NOT operator, range searching, pattern matching, Oracle functions, string functions, numeric functions, a conversion function, date function. It includes the following functions that include, MAX, SUM, ABS, POWER, ROUND, SQRT, LOWER, INITCAP, UPPER, SUBSTR, LENGTH, LTRIM, RTRIM, LPAD, RPAD ETC. All the commands explained with syntax and example.
PL/SQL Tutorial | User Defined Exception | Pragma Exception_INIT in Oracle Database 11g
 
23:33
Learn in depth with example about creating user defined exception using Pragma Exception_INIT and Raise_application_error following handling of different types of system named and unnamed exception in details. How to handle exception in oracle database, How to handle user defined exception in oracle database, What is Pragma in Exception Handling, What is Pragma Exception_INIT in oracle, Types of exception available in oracle, How to use Raise_application_error in oracle, How to use custom exception in oracle, How to use pragma autonomous transaction, SQLERRM, SQLCODE, Raise_application_error, In Oracle PL/SQL, PRAGMA refers to a compiler directive or "hint" it is used to provide an instruction to the compiler. The 5 types of Pragma directives available in Oracle are listed below: * PRAGMA AUTONOMOUS_TRANSACTION * PRAGMA SERIALLY_REUSABLE * PRAGMA RESTRICT_REFRENCES * PRAGMA EXCEPTION_INIT * PRAGMA INLINE Details of System Exception: DUP_VAL_ON_INDEX ORA-00001 You tried to execute an INSERT or UPDATE statement that has created a duplicate value in a field restricted by a unique index. TIMEOUT_ON_RESOURCE ORA-00051 You were waiting for a resource and you timed out. TRANSACTION_BACKED_OUT ORA-00061 The remote portion of a transaction has rolled back. INVALID_CURSOR ORA-01001 You tried to reference a cursor that does not yet exist. This may have happened because you've executed a FETCH cursor or CLOSE cursor before OPENing the cursor. NOT_LOGGED_ON ORA-01012 You tried to execute a call to Oracle before logging in. LOGIN_DENIED ORA-01017 You tried to log into Oracle with an invalid username/password combination. NO_DATA_FOUND ORA-01403 You tried one of the following: You executed a SELECT INTO statement and no rows were returned. You referenced an uninitialized row in a table. You read past the end of file with the UTL_FILE package. TOO_MANY_ROWS ORA-01422 You tried to execute a SELECT INTO statement and more than one row was returned. ZERO_DIVIDE ORA-01476 You tried to divide a number by zero. INVALID_NUMBER ORA-01722 You tried to execute a SQL statement that tried to convert a string to a number, but it was unsuccessful. STORAGE_ERROR ORA-06500 You ran out of memory or memory was corrupted. PROGRAM_ERROR ORA-06501 This is a generic "Contact Oracle support" message because an internal problem was encountered. VALUE_ERROR ORA-06502 You tried to perform an operation and there was a error on a conversion, truncation, or invalid constraining of numeric or character data. CURSOR_ALREADY_OPEN ORA-06511 You tried to open a cursor that is already open. Linkedin: https://www.linkedin.com/in/aditya-kumar-roy-b3673368/ Facebook: https://www.facebook.com/SpecializeAutomation/
The Psychology Behind Hard-Coding in PL/SQL
 
03:39
The Psychology Behind Hard-Coding Since we write software using our brains, it is hard to avoid the impact of psychology and physiology of our brains on our code. This manifests quite clearly when it comes to hard-coding. See the Practically Perfect PL/SQL YouTube channel for related videos. https://www.youtube.com/channel/UCpJpLMRm452kVcie3RpINPw ================================================== Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
SQL Numeric Functions
 
02:07
SQL few Numeric Functions
Views: 37 VBA Misztu
ORACLE  SQL Coding Lesson 3 in Jinghpaw Language - More Character and Numeric Functions
 
44:14
SQL Coding Lesson 3 in Jinghpaw Language - Lessons Continued. Please watch in HD mode for better video quality. --numeric functions SELECT ABS(12) FROM DUAL; SELECT ABS(-12.65) FROM DUAL; SELECT CEIL(48.99) FROM DUAL; SELECT CEIL(48.11) FROM DUAL; SELECT FLOOR(49.99) FROM DUAL; SELECT FLOOR(49.11) FROM DUAL; SELECT ROUND(49.11321,2) FROM DUAL; SELECT ROUND(49.11321,3) FROM DUAL; SELECT POWER(4,2) FROM DUAL; SELECT POWER(3,4) FROM DUAL; SELECT MOD(4,2) FROM DUAL; SELECT MOD(5051,100) FROM DUAL; select greatest(34,567,290,86) from dual; select least(34,567,290,86) from dual; select INSTR('Tech on the net', 'e') from dual; select INSTR('Tech on the net', 'e', 1, 1) from dual; select TRIM(' tech ') from dual; select TRIM(' ' FROM ' tech ') from dual; select TRIM(LEADING '0' FROM '000123') from dual; select TRIM(BOTH '1' FROM '123Tech111') from dual; select GREATEST(2, 5, 12, 3) from dual; select GREATEST('2', '5', '12', '3') from dual; select GREATEST('apples', 'oranges', 'bananas') from dual; select LEAST('2', '5', '12', '3') from dual; --null select (9000*null) from dual; select (null/9000) from dual; select (9000-null) from dual; select (9000+null) from dual; select distinct department_id from employees where commission_pct is not null; select last_name,job_id,coalesce(department_id,0) as dept,salary,commission_pct,coalesce(commission_pct,0) as comm_not_null, salary*commission_pct as multiplied_by_null, salary*coalesce(commission_pct,0) as commission_amt, salary+ (salary*coalesce(commission_pct,0)) as salary_plus_comm from employees where commission_pct is not null or department_id=20 order by dept; desc locations; select coalesce(postal_code,city,STATE_PROVINCE,COUNTRY_ID) as new_address,postal_code,city,STATE_PROVINCE,COUNTRY_ID from locations where COUNTRY_ID in ('JP','IT','UK'); --add more departments SELECT first_name ||'.'||last_name as "Employee Name",department_id, CASE when department_id in (10) THEN 'Accounting' WHEN department_id in (20) THEN 'Research' -- WHEN commission_pct is not null THEN 'Sales' WHEN department_id in (30) THEN 'Operations' ELSE 'Unknown' END department FROM employees ORDER BY first_name ||'.'||last_name ; SELECT last_name, department_id, DECODE( department_id ,10 ,'Accounting' ,20 ,'Research' ,30 ,'Sales' ,40 ,'Operations' ,'Unknown') department FROM employees ORDER BY last_name; select country_id,decode(country_id,'BR','Southern Hemisphere', 'AU','Southern Hemisphere', 'Northen Hemisphere') hemisphere from locations order by hemisphere; --set define on; select 'Coke & Popcorn' from dual; --upper,lower,coalesce and null select upper('sql') from dual; select lower('SQL') from dual; select initcap('sql') from dual; Select * from employees where email like '%SON'; Select * from employees where lower(email) like '%son'; Select * from employees where upper(last_name) like '%SON'; Select * from employees where lower(job_id) ='pu_clerk'; Select * from employees where initcap(email) ='Sbaida'; select * from employees where substr(phone_number,1,3) eq '515'; select * from employees where substr(phone_number,1,3) ne '515'; select * from employees where last_name gt 'King'; select * from employees where hire_date lt '01-JAN-1992'; --special character select * from jobs where job_id like 'SA\_%' escape '\'; select * from jobs where job_id like 'SA$_%' escape '$'; --translate, replace --( string1, string_to_replace, replacement_string ) select TRANSLATE('1tech23', '123', '456') from dual; select phone_number,translate(phone_number,'.','-') as modified_phnum from employees where rownum le 10; select job_id,translate(job_id,'_','&') as modified_phnum from employees where rownum le 10; select phone_number,translate(phone_number,'515','415') as modified_phnum from employees where rownum le 5; select phone_number,REPLACE(phone_number,'515','415') as modified_phnum from employees where rownum le 5; select REPLACE('123123tech', '123') from dual; select REPLACE('123tech123', '123') from dual; select REPLACE('222tech', '2', '3') from dual;
Views: 42 Hkau Doi
Foreign Key in Oracle
 
07:00
Foreign Key in Oracle oracle foreign key WHAT IS A FOREIGN KEY IN ORACLE? 1)A foreign key is a use to make referential integrity in database. 2)Foreign key values in one table must also appear in another table also. 3)The referenced table is called the parent table. 4)Table with the foreign key is called the child table. 5)The foreign key generally reference a primary key in the parent table. CREATE TABLE DEPT --- parent table ( DEPT_ID NUMERIC(10) NOT NULL, EMP_ID NUMERIC(10) NOT NULL, CONSTRAINT DEP_PK PRIMARY KEY (DEPT_ID) ); CREATE TABLE EMPLOYEE -- child table ( EMP_ID NUMERIC(10) NOT NULL, NAME VARCHAR2(50) NOT NULL, CITY VARCHAR2(50), DEPT_NO NUMERIC(10), CONSTRAINT ID_PK PRIMARY KEY (EMP_ID), CONSTRAINT FK_DEP FOREIGN KEY (DEPT_NO) REFERENCES DEPT(DEPT_ID) ); #techquerypond https://techquerypond.wordpress.com https://twitter.com/techquerypond
Views: 410 Tech Query Pond
SQL Server 2016 (New feature): How to use Dynamic Data Masking
 
04:38
Want to selectively hide or scramble sensitive data? In this video, I'll show you how to use a new feature/tool in SQL Server 2016, called Dynamic Data Masking, that allows you to partly obfuscate certain columns of data in a table or view. -- Hey, if you enjoyed this video, please SUBSCRIBE to HandyAndy Tech Tips! -- My notes on this topic: - Now, to add the masking, you COULD define the masking in the table definition statement, but I'll use the ALTER TABLE statement. Anyway, the basic syntax is the same: MASKED WITH (FUNCTION = ''). The string can basically be one of four functions. - The easiest is default() - everything is automatic. It: ---- on a TEXT FIELD, replaces the original value of the field with 4 X's. ---- on a DATE FIELD, set s the date to 1900-01-01 00:00:00.00 ---- on a NUMERIC FIELD, sets the value to 0. - email() only shows the first letter, and replaces the remainder of the field with X's, an @ symbol, and a standard .com suffix. It, of course, also works on fields that don't include actual email addresses - so it therefore works on any VARCHAR or CHAR. - partial() - When used as partial(no-of-chars-to-reveal-before, padding, chars-to-reveal-after), it reveals the first character and the last two, separated by a string of X's. This also only works on strings - not on numeric types or dates. - random(lower-bound, upper-bound) replaces the field's original value with a randomly-generated number between 1 and 10. This, of course, only works with numeric data types like INT. - Now, it's worth noting that if you want to give a particular user - or role - the ability to see all of the data in its unmasked form, then you can simply grant them the UNMASK privilege. Annoyingly, this doesn't seem to work on a table level, only for the entire database.
Views: 2580 HandyAndy Tech Tips
Part 6   Transform rows into columns in sql server
 
08:53
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/06/part-6-transform-rows-into-columns-in.html This is another common sql server interview question. We will be using Countries table in this example. SQL to create the table Create Table Countries ( Country nvarchar(50), City nvarchar(50) ) GO Insert into Countries values ('USA','New York') Insert into Countries values ('USA','Houston') Insert into Countries values ('USA','Dallas') Insert into Countries values ('India','Hyderabad') Insert into Countries values ('India','Bangalore') Insert into Countries values ('India','New Delhi') Insert into Countries values ('UK','London') Insert into Countries values ('UK','Birmingham') Insert into Countries values ('UK','Manchester') Here is the interview question. Write a sql query to transpose rows to columns. Using PIVOT operator we can very easily transform rows to columns. Select Country, City1, City2, City3 From ( Select Country, City, 'City'+ cast(row_number() over(partition by Country order by Country) as varchar(10)) ColumnSequence from Countries ) Temp pivot ( max(City) for ColumnSequence in (City1, City2, City3) ) Piv
Views: 179110 kudvenkat
Session6 Data type in Oracle
 
15:25
Session 6: Datatypes In Oracle   ALPHABET           : A-Z , a-z NUMBER              : 0-9 (with precision and scale) DATE / Temporal  : any Date and time (Hours, Minutes, Seconds, Mili-seconds, Timestamp, Timezone etc)   Alphabet + Number = Alphanumeric Data                                     = String / CHARACTER Datatype Category Number                    =  Numeric Datatype Category Date                         = Date Datatype Category 1. CHARACTER Datatype: CHAR, VARCHAR, NCHAR: CHAR is fixed length datatype and VARCHAR is Variable length datatype to store character data. i.e. A-Z , a-z , 0-9 , all keyboard characters etc. The default size is 1 character and it can store maximum up to 2000 bytes. Example : EName, EmpID, PassportNo, SSN, etc. EName CHAR(10) := ‘TOM’; wastage of 7 space after the string EName VARCHAR(10) := ‘TOM’; Spaces can be Reuse which left after the string NCHAR additionally handles NLS(National Language Support). Oracle supports a reliable Unicode datatype through NCHAR , NVARCHAR2 , and NCLOB  VARCHAR2, NVARCHAR2: These are Variable length datatype. VARCHAR2 handles alphanumeric character string whereas NVARCHAR2 handles alphanumeric character string with NLS(National Language Support). The default size is 1 character and it can store maximum up to 4000 bytes.   LONG:  Variable length string.  (Maximum size: 2 GB - 1) Only one LONG column is allowed per table. RAW:    Variable length binary string (Maximum size 2000 bytes) LONG RAW: Variable length binary string (Maximum size 2GB) 2. NUMERIC Datatype: NUMBER: It stores Numeric values and performs numeric calculations. NUMBER,   NUMBER(n),   NUMBER(p,s) It stores Numbers up to 38 digits of precision. SeqNo NUMBER;                     1, 123, 12345678 EmpID NUMBER(4);                 1, 123, 1234 Sal NUMBER(7,2);                     23456.78 , 123.45 — correction in video: Sal NUMBER(a7,2); which is wrong please ignore. 1234567 can be a type of NUMBER, NUMBER(7), NUMBER(7,0) It can store both integer and floating point numbers NUMERIC(p,s) FLOAT:   Ex:  EmpSal FLOAT;    FLOAT(7)       Decimal Points allowed DEC(p,s), DECIMAL(p,s) , REAL, DOUBLE PRECISION INTEGER:   Ex:  SSN INTEGER;       Decimal Points are not allowed INT, SMALLINT 3. DATE Datatype: DATE: It stores DATE(Date, Month, Year) and Time(Hour, Minute, Second, AM/PM) and performs calculations with such data. Default DATE format in Oracle is “DD-MON-YY” Based on "Gregorian calendar" where the date ranges from “JAN 1 4712 BC” to “DEC 31 9999 AD” doj DATE;    “18-MAR-2010 12:30:00 PM” TIMESTAMP:    It can store all parameters as DATE datatype and additionally it can have “Fraction of seconds” and TIMESTAMP WITH TIMEZONE / TIMESTAMP WITHOUT TIMEZONE. Range from 0-9 digits, the default size is 6. 4. LOB Datatype: LOB: “Large Object” data. It can store pictures, motion pictures, Textfiles etc. CLOB: “Character Large Object” is used to store structured information like a text file with a specific file format. BLOB: “Binary Large Object” is used to store Un-structured information like Image, JPEG files, MPEG files etc. BFILE: “Binary File” is used to store the pointer to a specific file / Just store the location of a file. Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) Extra Information: NCLOB : It supports all the character set supported by CLOB and additionally it handles NLS(National Language Support ) Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) ROWID and UROWID(optional size) Datatype: contains fixed length Binary data. BBBBBBB.RRRR.FFFFF combination of BLOCK-ROW-DATABASE FILE Physical and Logical ROWID Upcoming Session: Session 7: Populating Data into Tables(INSERT Statement): Inserting data into all columns of a table Inserting data into Required columns of a table Inserting NULL value into a table Inserting Special Values(USER / SYSDATE) into a table Supplying data at runtime(using & and &&) THANK YOU :)
How to Concatenate String Values with Integer values in SQL Server - TSQL Tutorial
 
10:23
How to Concatenate String and Integer Values in SQL Server ( + Sign vs CONCAT ) - TSQL Tutorial Working with Databases is fun. On daily basis we save data into tables in different columns and often we need to write queries which involve concatenation of multiple columns of different datatypes to produce our final output. In below example we have saved some data into #Customer Table which has Street Address column as string and zip as INT. we want to produce Full Address by concatenating these columns. To concatenate we can use + sign but this works only with String values. So if we have any Integer value/s we have to convert them to String first. We can use Cast or Convert function to convert Integer value to string. Also if there is any Null value among which values we are concatenating , our output will be Null by using + sign. To take care of that part we can use either ISNULL() or Coalesce Function to replace NULL with blank value in SQL Server. In SQL Server 2012 and Later versions, CONCAT function was introduced. You can concatenate multiple values by using this function. Fun part of this function is you don't have to worry about Null outcome as it will Ignore Null values and also you don't have to worry about converting INT into strings, It will take care of that automatically. So if you are using new versions such as 2012 or later, start taking advantage of this function. Blog post link for the video with script http://sqlage.blogspot.com/2015/03/how-to-concatenate-string-and-integer.html
Views: 14647 TechBrothersIT
Oracle NULLIF Function
 
02:29
https://www.databasestar.com/oracle-nullif/ The Oracle NULLIF function is used to compare two values and determine if they match or not. If the two values match, NULLIF returns NULL. If they don’t match, the function returns the first value. The syntax of the NULLIF function is: NULLIF (expr1, expr2) These parameters are the two expressions to compare. As mentioned above, this function returns either: - NULL if expr1 and expr2 match - expr1 if expr1 and expr2 don't match Both of these parameters can be numeric, and they both need to be the same data type. The functionality of NULLIF can be written as a CASE statement. However, if a CASE statement is really what you need, then you should use that. NULLIF should only be used if that’s the functionality you require. For more information about the Oracle NULLIF function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-nullif/
Views: 187 Database Star
Cast and Convert functions in SQL Server   Part 28
 
17:26
In this video we will learn, converting one data type to another using cast() and convert() functions. We will also learn how to use the style parameter, with convert() function. Finally we will look at a practical example of using CAST or CONVERT functions, along with group by. We will also talk about the differences between CAST and CONVERT functions and when to choose one over the other. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/cast-and-convert-functions-in-sql.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-28-cast-and-convert-functions.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 169037 kudvenkat
Oracle GREATEST Function
 
02:43
https://www.databasestar.com/oracle-greatest/ The Oracle GREATEST function is a useful function, but I don’t think it’s very well understood. It returns the greatest or largest value in a set of values. You can provide the values, and use numbers or text values. The syntax for the Oracle GREATEST function is: GREATEST(expr1 [, expr_n]) The expr1 is the first expression to use for your comparison. Expr_n is one or more expressions to use in the comparison, separated by commas. This is optional. So how is GREATEST calculated? If the parameters are numeric, the GREATEST function finds the largest number. If the parameters are characters, the function finds the latest value if they were sorted alphabetically (using their character values). What data type is returned? It depends on the parameters you provide. It could be the same as the parameters you provide, or VARCHAR2 if the parameters are all characters. You can also use the GREATEST function with dates. It’s also the opposite of the LEAST function. For more information on the GREATEST function, including the SQL used in this video and the examples, read the related post here: https://www.databasestar.com/oracle-greatest/
Views: 209 Database Star
Oracle Database Tutorial 7: The "Like" Operator In Sql
 
04:29
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two wildcards used in conjunction with the LIKE operator: % - The percent sign represents zero, one, or multiple characters _ - The underscore represents a single character Note: MS Access uses a question mark (?) instead of the underscore (_). The percent sign and the underscore can also be used in combinations! LIKE Syntax SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern; Tip: You can also combine any number of conditions using AND or OR operators. Here are some examples showing different LIKE operators with '%' and '_' wildcards: LIKE Operator Description WHERE CustomerName LIKE 'a%' Finds any values that starts with "a" WHERE CustomerName LIKE '%a' Finds any values that ends with "a" WHERE CustomerName LIKE '%or%' Finds any values that have "or" in any position WHERE CustomerName LIKE '_r%' Finds any values that have "r" in the second position WHERE CustomerName LIKE 'a_%_%' Finds any values that starts with "a" and are at least 3 characters in length WHERE ContactName LIKE 'a%o' Finds any values that starts with "a" and ends with "o" sql like wildcard sql like multiple values sql like pattern like query in mysql sql like regex sql not like in operator in sql sql like escape 1 2 3 4 5 6 7 8 9 10 Next
SQL Tutorial 2: Overview of SQL
 
40:34
http://www.gcreddy.com/2016/08/sql-overview.html Overview of SQL, Structured Query Language Syntax, SQL Data Types, SQL Operators, SQL Built in Functions, SQL Queries and Sub Queries. Data Definition Language, Data Manipulation Language and Data Control Language Commands. Overview of Structured Query Language • SQL (Structured Query Language) is a standard language for accessing databases. • All Relational Database Management Systems like MS Access, MS SQL Server, Oracle, Sybase, MySQL, DB2 use SQL as standard database language. i. Environment Setup We can practice SQL Commands in any Database Management System, Install any Database Engine and practice. ii. SQL Syntax • A database contains one or more tables. Each table is identified by a name, Tables contain records (rows. with data. • Most of the actions we need to perform on a database are done with SQL statements. • SQL keywords are Not case sensitive: select is the same as SELECT • All the SQL statements start with any of the keywords like SELECT, INSERT, UPDATE, DELETE etc... and all the statements end with a semicolon (;., it is the standard way to separate SQL Statements. iii. SQL Data Types • A data type defines what kind of value a column can contain, we have to use data types while creating database tables, choose a particular data type for a table column based on our requirement. Example: Character Data Types Numeric Data Types Date and Time Data Types Etc... • Data Types vary from One Database Management System to another iv. Operators Operators are used to perform Arithmetic, Comparison and Logical Operations. Categories of Operators in SQL 1. Arithmetic Operators 2. Comparison Operators 3. Logical Operators v SQL Functions SQL has many built-in functions for performing processing on data. Categories of Built-in Functions in SQL 1. Aggregate Functions 2. String Functions 3. Date Functions Etc... vi. Data Definition Language The Data Definition Language (DDL) is used to create and destroy databases and database objects. Important Operations • Create Database • Use Database (Specify the Database you wish to work with within your DBMS) • Alter Database • Drop Table, Drop Database vii. Data Manipulation Language The Data Manipulation Language (DML. is used to insert, retrieve and modify database information) Important Operations • Insert Records to an existing Table • Retrieve the specific information from an operational database. • Modify information contained within a Table. • Delete information contained within a Table. viii. Data Control Language The Data Control Language (DCL) allows database administrators to configure security access to relational databases. Important Operations • Provide access on the Database objects to the Users • Remove User access rights to the Database Objects • Deny Permissions to Users. ix. SQL SELECT Statement The SELECT statement is used to select data from a database. • General Selection • Conditional Selection Etc... (We use clauses, Operators and keywords...) x. SQL Joins The SQL Joins clause is used to combine records from two or more tables in a database. Different SQL Joins: 1. Inner Join 2. Left Join 3. Right Join 4. Full Join ----------------------------------------------------
Views: 55214 G C Reddy
SQL Tutorial 7: SQL Operators
 
25:45
http://www.gcreddy.com/2017/06/sql-operators.html SQL Operators, Arithmetic Operators, Comparison Operators, Compound Operators, and Logical Operators. SQL Operators examples with SQL Where clause to form single and multiple Conditions. An operator is a reserved word or a character used primarily in an SQL statement's WHERE clause to perform operation(s., such as arithmetic, comparisons and Logical operations. Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement. Important Categories of SQL Operators are, 1. Arithmetic operators 2. Comparison operators 3. Logical operators Etc... ----------------------------- 1. Arithmetic Operators: Arithmetic operators can perform arithmetical operations on numeric operands involved. 2. Comparison Operators: A comparison (or relational. operator is a mathematical symbol which is used to compare between two values. Comparison operators are used in conditions that compare one expression with another. The result of a comparison can be TRUE, FALSE, or UNKNOWN (an operator that has one or two NULL expressions returns UNKNOWN.. 3. Logical operators: There are three Logical Operators namely, AND, OR, and NOT. These operators compare two conditions at a time to determine whether a row can be selected for the output. When retrieving data using a SELECT statement, You can use logical operators in the WHERE clause, which allows you to combine more than one condition.
Views: 13215 G C Reddy
SQL 077 Numeric Scalar, EXP or Natural logarithm to the power of e
 
01:27
Explains the Numeric Scalar Function EXP for finding the natural logarithm e to the power of the argument. From http://ComputerBasedTrainingInc.com SQL Course. Learn by doing SQL commands for ANSI Standard SQL, Access, DB2, MySQL, Oracle, PostgreSQL, and SQL Server.
Views: 119 cbtinc
Grouping Functions in SQL Query Like AVG,SUM,MAX,MIN
 
04:03
SQL COUNT (): This function returns the number of rows in the table that satisfies the condition specified in the WHERE condition. If the WHERE condition is not specified, then the query returns the total number of rows in the table. For Example: If you want the number of emps in a particular department, the query would be: SELECT COUNT (*) FROM emp WHERE deptno = 10; If you want the total number of emps in all the department, the query would take the form: SELECT COUNT (*) FROM emp; SQL DISTINCT(): This function is used to select the distinct rows. For Example: If you want to select all distinct department names from emp table, the query would be: SELECT DISTINCT deptno FROM emp; To get the count of emps with unique name, the query would be: SELECT COUNT (DISTINCT name) FROM emp; SQL MAX(): This function is used to get the maximum value from a column. To get the maximum salary drawn by an emp, the query would be: SELECT MAX (salary) FROM emp; SQL MIN(): This function is used to get the minimum value from a column. To get the minimum salary drawn by an emp, he query would be: SELECT MIN (salary) FROM emp; SQL AVG(): This function is used to get the average value of a numeric column. To get the average salary, the query would be SELECT AVG (salary) FROM emp; SQL SUM(): This function is used to get the sum of a numeric column To get the total salary given out to the emps, SELECT SUM (salary) FROM emp;
Views: 11382 WingsOfTechnology
SQL 074 Numeric Scalar, BIT_LENGTH or How many bits in the strings?
 
01:21
Explains the Numeric Scalar Function BIT_LENGTH for finding the number of bits in the string or expression. From http://ComputerBasedTrainingInc.com SQL Course. Learn by doing SQL commands for ANSI Standard SQL, Access, DB2, MySQL, Oracle, PostgreSQL, and SQL Server.
Views: 146 cbtinc
PL/SQL tutorial 30: Cursor FOR Loop In Oracle Database By Manish Sharma
 
04:33
Learn How To Work with Database (Explicit or Implicit) Cursors using Cursor For Loop in Oracle Database With Example By Manish Sharma on RebellionRider.com ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/cursor-for-loop-1 Previous Tutorial ► Numeric For Loop: https://youtu.be/DfAmnj2j7WI ►Install SQL Developer: https://youtu.be/zliF8kXVmeE ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ ___Facebook Official Page___ https://www.facebook.com/RebellionRider.official/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 35209 Manish Sharma
Difference between sequence and identity in SQL Server
 
05:29
sql server identity vs sequence In this video we will discuss the difference between SEQUENCE and IDENTITY in SQL Server This is continuation to Part 134. Please watch Part 134 from SQL Server tutorial before proceeding. Sequence object is similar to the Identity property, in the sense that it generates sequence of numeric values in an ascending order just like the identity property. However there are several differences between the 2 which we will discuss in this video. Identity property is a table column property meaning it is tied to the table, where as the sequence is a user-defined database object and is not tied to any specific table meaning it's value can be shared by multiple tables. Example : Identity property tied to the Id column of the Employees table. CREATE TABLE Employees ( Id INT PRIMARY KEY IDENTITY(1,1), Name NVARCHAR(50), Gender NVARCHAR(10) ) Example : Sequence object not tied to any specific table CREATE SEQUENCE [dbo].[SequenceObject] AS INT START WITH 1 INCREMENT BY 1 This means the above sequence object can be used with any table. Example : Sharing sequence object value with multiple tables. Step 1 : Create Customers and Users tables CREATE TABLE Customers ( Id INT PRIMARY KEY, Name NVARCHAR(50), Gender NVARCHAR(10) ) GO CREATE TABLE Users ( Id INT PRIMARY KEY, Name NVARCHAR(50), Gender NVARCHAR(10) ) GO Step 2 : Insert 2 rows into Customers table and 3 rows into Users table. Notice the same sequence object is generating the ID values for both the tables. INSERT INTO Customers VALUES (NEXT VALUE for [dbo].[SequenceObject], 'Ben', 'Male') INSERT INTO Customers VALUES (NEXT VALUE for [dbo].[SequenceObject], 'Sara', 'Female') INSERT INTO Users VALUES (NEXT VALUE for [dbo].[SequenceObject], 'Tom', 'Male') INSERT INTO Users VALUES (NEXT VALUE for [dbo].[SequenceObject], 'Pam', 'Female') INSERT INTO Users VALUES (NEXT VALUE for [dbo].[SequenceObject], 'David', 'Male') GO Step 3 : Query the tables SELECT * FROM Customers SELECT * FROM Users GO Output : Notice the same sequence object has generated the values for ID columns in both the tables To generate the next identity value, a row has to be inserted into the table, where as with sequence object there is no need to insert a row into the table to generate the next sequence value. You can use NEXT VALUE FOR clause to generate the next sequence value. Example : Generating Identity value by inserting a row into the table INSERT INTO Employees VALUES ('Todd', 'Male') Example : Generating the next sequence value using NEXT VALUE FOR clause. SELECT NEXT VALUE FOR [dbo].[SequenceObject] Maximum value for the identity property cannot be specified. The maximum value will be the maximum value of the correspoding column data type. With the sequence object you can use the MAXVALUE option to specify the maximum value. If the MAXVALUE option is not specified for the sequence object, then the maximum value will be the maximum value of it's data type. Example : Specifying maximum value for the sequence object using the MAXVALUE option CREATE SEQUENCE [dbo].[SequenceObject] START WITH 1 INCREMENT BY 1 MAXVALUE 5 CYCLE option of the Sequence object can be used to specify whether the sequence should restart automatically when the max value (for incrementing sequence object) or min value (for decrementing sequence object) is reached, where as with the Identity property we don't have any such option to automatically restart the identity values. Example : Specifying the CYCLE option of the Sequence object, so the sequence will restart automatically when the max value is exceeded CREATE SEQUENCE [dbo].[SequenceObject] START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 5 CYCLE Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-sequence-and.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-sequence-and_27.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 32824 kudvenkat
Oracle CURRENT_DATE Function
 
01:54
https://www.databasestar.com/oracle-date-functions/ The Oracle CURRENT_DATE function is used to return the current date in the session timezone. The session timezone is the timezone that the current user is logging in from. This can be different from the database’s timezone. The syntax of the CURRENT_DATE function is: CURRENT_DATE No parameters are needed - just the function name. The function returns a DATE data type, and it includes hours, minutes, and seconds. This is good to know because the default display format for DATE does not include the time component, and it can be easy to forget. It’s different to the SYSDATE function as SYSDATE returns the date in the database timezone, and CURRENT_DATE returns the date in the session time zone. So, if I’m logging in from Melbourne, Australia, and the database is in London, England, then the CURRENT_DATE will return a date and time that’s 10 hours ahead of SYSDATE. It may be on the same day, or it could be a different day, depending on when I run the function. You can perform arithmetic on this function just like any other date value (e.g. CURRENT_DATE - 7 for 7 days ago). For more information about the Oracle CURRENT_DATE function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-date-functions/
Views: 73 Database Star
Get Decimal/Float output from Integer Division in SQL Server - SQL Server Tutorial
 
02:47
In this video we will learn how to get decimal/float output from Integer division in SQL Server. I am creating this video to answer once of the question that I posted while back for TSQL Interview Question list "If I run Select 100/11 what output will I get?" When you divide Integer by an Integer in SQL Server, SQL Server returns Integer output. As we can see from our above example, SQL Server output is Integer for Integers division. If we want to get float or Decimal output, Either our denominator or Numerator should be float or decimal type. If we have both denominator or numerator as Integers, we can use convert or cast functions to convert one of them to float/decimal so we can get our results as float/decimal. There are multiple techniques you can use to convert/cast to integer to float/decimal, here are some examples SELECT CAST(100 AS FLOAT) /11 AS OutputResult SELECT 100/CAST(11 AS FLOAT) AS OutputResult SELECT 100/CAST(11 AS DECIMAL(12,0)) AS OutputResult SELECT CAST(100 AS DECIMAL(12,0))/11 AS OutputResult Blog post link with scripts used in the video http://sqlage.blogspot.com/2015/02/how-to-get-decimail-output-from.html
Views: 10548 TechBrothersIT
SQL 082 Numeric Scalar, OCTET_LENGTH or How many 8 bits in a string?
 
01:13
Explains the Numeric Scalar Function OCTET_LENGTH or How many 8 bits in a string. From http://ComputerBasedTrainingInc.com SQL Course. Learn by doing SQL commands for ANSI Standard SQL, Access, DB2, MySQL, Oracle, PostgreSQL, and SQL Server.
Views: 111 cbtinc
10. INT and DEC Data Type in SQL (Hindi)
 
06:37
Please Subscribe Channel Like, Share and Comment Visit : www.geekyshows.com
Views: 23954 Geeky Shows
PL/SQL tutorial 13: PL/SQL FOR Loop In Oracle Database by Manish Sharma RebellionRider.com
 
06:14
3rd and the last tutorial in Iterative/loop statement in Oracle PL/SQL series explaining concepts of FOR loop with examples by Manish Sharma RebellionRider.com ------------------------------------------------------------------------ ►►►LINKS◄◄◄ Blog : http://bit.ly/numeric-for-loop-in-pl-sql Previous Tutorial ► While Loop https://youtu.be/IIlc4Sr7kFE ------------------------------------------------------------------------- ►►►Let's Get Free Uber Cab◄◄◄ Use Referral Code UberRebellionRider and get $20 free for your first ride. ------------------------------------------------------------------------- ►Make sure you SUBSCRIBE and be the 1st one to see my videos! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ►►►Find me on Social Media◄◄◄ Follow What I am up to as it happens on https://twitter.com/rebellionrider https://www.facebook.com/imthebhardwaj http://instagram.com/rebellionrider https://plus.google.com/+Rebellionrider http://in.linkedin.com/in/mannbhardwaj/ http://rebellionrider.tumblr.com/ http://www.pinterest.com/rebellionrider/ You can also Email me at for E-mail address please check About section Please please LIKE and SHARE my videos it makes me happy. Thanks for liking, commenting, sharing and watching more of our videos This is Manish from RebellionRider.com ♥ I LOVE ALL MY VIEWERS AND SUBSCRIBERS
Views: 50361 Manish Sharma
Sql server identity column - How to add Sql identity column by using SQL Mgmt studio 2012
 
01:29
sql server (starting with 2008) no azure database data warehouse parallel. By default the seed and increment are both 1 12 may 2008 an identity column has a name, initial step. How do i add an identity column to table in sql server? Sometime the questions can't find exact syntax for adding property existing. Sql server 2012 auto identity column value jump issue insert into sql table with. Resetting sql server identity columns blackwasp. Managing identity columns with replication in sql server. In these scenarios, see how to replicate tables with setting the identity property on a table when it is created simple task. Identity column in sql server stack overflowidentity wikipediawhy can a table not have more than one identity value falling behind randomly reset how to geek. And when you load it, an error is raised add a row into sql server table that has identity column, the value assigned to column in datatable replaced by generated many databases have ability create automatically incremented numbers. The below snippet will create table called sampletable with id column which has an 3 jun 2015 this is a small example about how to insert rows into setting value for identity on sql server. Auto generated identity column in ms sql server table confirm create with sequence indentity how to an add adding the property existing pro. Sql server performance how to remove the identity column in sql insert records with value ninja code. The metadata is stored at column level not table. My current assignment that i am i've found mapinfo data inserted into sql server spatial is flagged as invalid when try to load it in qgis. Basically the script will do 29 feb 2012 when you import a table with an identity column it is treated like any other regular int datatype. Identity (property) (transact sql) msdn microsoft. Getting an identity column value from sql server ado columns in oracle brent ozar unlimited. An identity column is a in database table that made up of values generated by the microsoft sql server you have options for both seed (starting value) and increment. Seeding and reseeding an identity column is easy relatively safe, if you do it correctly. Sql server identity vs sequence how to define an auto increment primary key in sql table that has reseeding the column eimagine. In sql server, we can use an identity property on a column. This means that as each row is inserted into the table, sql server will automatically increment this microsoft identity columns provide a useful way to generate consecutive numeric values for identifying rows. An example is if 15 jul 2008 microsoft sql server's identity column generates sequential values for new records using a seed value. It would need a rethink though of scalar we are having strange intermittent issue where the identity column randomly, one these tables' values will fall behind, stopping if you using an on your sql server tables, can set next insert value to whatever want. Is there someway to automatically add an identity column when sql server values check thomas larock. when instance is restarted then its auto identity column value jumped based on for customerid column, 'identity(1,1)' specified. Create table with identity column sequence indentity sql server t tutorial 27 jul 2013 here is the question i received on sqlauthority fan page. Sql server identity column? Sql auto increment a field w3schools. Using sql server management studio, i scripted a create to of the existing table and got this [dbo] why does doesn't allow more than one identity column an is ( also known as field ) in database writes 'how can reset not start where it left? ' i've been (this article has updated through 2005. The solution seems to be add an integer 'id' column, identity columns are defined on a table so that the database engine will for many oltp systems in sql server this is often ideal and what i managing with replicated tables your 2005 requires some tlc. Sql how to create table with identity column stack overflow. During 1 aug 2015 difference between sequence and identity in sql server object is introduced 2012, column property the second piece of puzzle constraint, which informs to auto increment numeric value within specified anytime a 21 jul 2016 trying use instead management studio, i have come it says that cannot insert explicit values for 4 sep 2014 when using as your database, you usually an primary key table. Creates an identity column in a table the ms sql server uses keyword to perform auto increment tip specify that 'id' should start at value 10 and by 5, create [dbo].
Views: 9057 Mahasen Powell
SQL 065 Scalar Functions, COALESCE or How do I get first non-NULL value?
 
01:11
Explains the Scalar Function COALESCE or How do I get the first non-NULL value. From http://ComputerBasedTrainingInc.com SQL Course. Learn by doing SQL commands for ANSI Standard SQL, Access, DB2, MySQL, Oracle, PostgreSQL, and SQL Server.
Views: 776 cbtinc

Entry level programmer cover letter examples
Sample cover letter for job application for hr officer
Buffalo state admissions essay for college
The cube 2012 application letters
Termios sample cover letter