×
Study like there’s no tomorrow because if you keep putting off your studies for tomorrow, you’ll probably be too late.
--Your friends at LectureNotes
Close

Notes on advance sql

  • Other
  • 12 Views
  • Uploaded 4 months ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Chapter 4: Advanced SQL Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use

Text from page-2

Chapter 4: Advanced SQL SQL Data Types and Schemas Integrity Constraints Authorization Embedded SQL Dynamic SQL Functions and Procedural Constructs** Recursive Queries** Advanced SQL Features** Database System Concepts, 5th Ed., July 2005 4.2 ©Silberschatz, Korth and Sudarshan

Text from page-3

Built-in Data Types in SQL date: Dates, containing a (4 digit) year, month and date Example: date ‘2005-7-27’ time: Time of day, in hours, minutes and seconds. Example: time ‘09:00:30’ time ‘09:00:30.75’ timestamp: date plus time of day Example: timestamp ‘2005-7-27 09:00:30.75’ interval: period of time Example: interval ‘1’ day Subtracting a date/time/timestamp value from another gives an interval value Interval values can be added to date/time/timestamp values Database System Concepts, 5th Ed., July 2005 4.3 ©Silberschatz, Korth and Sudarshan

Text from page-4

Build-in Data Types in SQL (Cont.) Can extract values of individual fields from date/time/timestamp Example: extract (year from r.starttime) Can cast string types to date/time/timestamp Example: cast <string-valued-expression> as date Example: cast <string-valued-expression> as time Database System Concepts, 5th Ed., July 2005 4.4 ©Silberschatz, Korth and Sudarshan

Lecture Notes