Tag: Dates
Restricting Data – Selection in the WHERE Clause
Exam Topic: Restricting and Sorting Data – Limit the rows that are retrieved by a query Returning the right data by restricting rows to answer questions is at the heart of SQL Development. As shown in The Capabilities of a SQL SELECT Statement, the WHERE clause is used to specify conditions for which rows should be returned. If the […]
Continue Reading...Gotchas with the Oracle DATE Datatype
DATE is a common datatype. Most transactions in a database have a date associated with them for tracking purposes. When was the order made? When is the order expected to be delivered? When was it actually delivered? And so on. Querying dates, however, takes some attention to detail as there are many details to consider […]
Continue Reading...INTERVAL: Clock Math
INTERVAL is a function that provides a way to add, subtract or just convert. SELECT INTERVAL ‘300’ MONTH, INTERVAL ’54-2′ YEAR TO MONTH, INTERVAL ’11:12:10.1234567′ HOUR FROM DUAL; Which is the correct output of the above query? A. +25-00, +54-02, +00 11:12:10.123457 B. +00-300, +54-02,+00 11:12:10.123457 C. +25-00,+00-650,+00 11:12:10.123457 D. +00-300,+00-650,+00 11:12:10.123457
Continue Reading...