Common SQL Questions

Size: px
Start display at page:

Download "Common SQL Questions"

Transcription

1 L04 Common SQL Questions Why and How-to Tuesday, May 9, :30a.m. 09:40 a.m. There are a few questions that come up time and time again. Why do certain SQL statements behave the way they do, and how do I get a particular set of results? This presentation will cover some of the most frequently asked SQL-related questions. We'll also discuss how to find out how others have found answers and solutions to similar problems. 1

2 Agenda Using DATE and DATETIME in calculations Putting limits and order on rows returned User-Defined Routines and SPL considerations Explain plan query estimates Replace newlines in text 2 2

3 How can I manipulate dates and times? Common problems with date and time manipulation are due to misunderstandings about the data types. There are a number of built-in functions that will help. 3 3

4 Date and Time Data types DATE (mm/dd/yyyy) DATETIME (yyyy-mm-dd hh:mm:ss.nnnnn) INTERVAL (year-month OR day-time) 4 -The DBDATE and GL_DATE environment variables may be used to change the default DATE format. -The default precision for DATETIME fraction is 3 digits; may use as many as 5. -Can not combine the two INTERVAL classes. 4

5 DATE Stored internally as an integer Value is equal to the number of days since December 31, 1899 DATE(1) = 01/01/1900 DATE(38717) = 01/01/ The DATE function will be described in a few slides. 5

6 DATETIME Stores an instant in time as a date and time of day Precision defined from a year to a fraction of a second DATETIME YEAR TO FRACTION(3) :03: Year Day Minute Fraction Month Hour Second 6 Note the format of the DATETIME example. -Hyphen is used between the date portion of the DATETIME -Space separates date from time -Colon is used between hour and minutes, and minutes and seconds -Decimal point separates the fraction from seconds 6

7 INTERVAL Represents a span of time - independent of any actual date Year-Month intervals YEAR, MONTH Day-Time intervals DAY, HOUR, MINUTE, SECOND, FRACTION 7 Because the interval is independent of a specific date, you cannot combine the two classes of intervals. As the number of days in a given month (and some years) varies, a single interval value cannot combine months and days. 7

8 Date/Time Keywords TODAY Returns the system date as a DATE value e.g. select TODAY from systables where tabid = 1; returns: 02/17/2006 CURRENT Returns a DATETIME value representing the current moment e.g. select CURRENT from systables where tabid = 1; returns: :37:

9 Date/Time Built-in Functions DATE DAY MONTH YEAR MDY EXTEND WEEKDAY 9 To do: Include examples for each function. Also include examples of mixing the results of the functions with other mathematical operations. Pay particular attention to the EXTEND function. 9

10 DATE Returns a date value that corresponds to a nondate expression DATE(non-date expression) SELECT * FROM orders WHERE order_date > DATE( 05/01/2006 ) 10 See the examples at the beginning of this section where an INTEGER is used as an argument. 10

11 DAY Returns an integer representing the day of the month DAY(date/datetime expression) SELECT * FROM orders WHERE DAY(order_date) > Search for orders that were placed after the 15th day of any month. 11

12 MONTH Returns an integer representing the month portion of a DATE or DATETIME MONTH(date/datetime expression) SELECT * FROM cust_calls WHERE MONTH(call_dtime) = Select all from cust_calls where the call was recorded in December (12th month). 12

13 YEAR Returns a four-digit integer that represents the year YEAR(date/datetime expression) SELECT * FROM orders WHERE YEAR(paid_date) = YEAR(TODAY) 13 Select all orders that were paid in the current year. 13

14 MDY Returns a DATE value with three expressions that evaluate to integers that represent the month, day, and year MDY(month,day,year) UPDATE orders SET ship_date = MDY(MONTH(TODAY) + 1, 1, YEAR(TODAY)) WHERE order_date = TODAY 14 Update the orders table, setting the ship date to the first day of next month (based on today s date) for all orders placed today. 14

15 EXTEND Adjusts the precision of a DATETIME or DATE value EXTEND(date/datetime expression, first TO last) SELECT EXTEND(TODAY, YEAR TO MINUTE) FROM systables WHERE tabid = 1; Returns: :00 15 We are extending the precision of TODAY so that it includes hours and minutes. 15

16 WEEKDAY Returns an integer that represents a day of the week (0 = Sunday, 6 = Saturday) WEEKDAY(date/datetime expression) SELECT * FROM cust_calls WHERE WEEKDAY(call_dtime) = 5 16 Find all customer calls that came in on a Friday. 16

17 UNITS of time YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, FRACTION SELECT * FROM call_log WHERE call_date >= (TODAY - 7 UNITS DAY) 17 17

18 Adding and Subtracting time Why do I get an error when I subtract a month? Example: Let s say today is 03/30/2005 Today - 1 UNITS MONTH = ERROR 02/30/2005 is an invalid date! 18 18

19 How do I get the first day of the previous or next month? SELECT order_num, order_date, DATE(EXTEND(order_date, YEAR TO MONTH) - 1 UNITS MONTH) AS prev_month, DATE(EXTEND(order_date, YEAR TO MONTH) + 1 UNITS MONTH) AS next_month FROM orders 19 In this example, we are adjusting the precision of the order date so that we are taking just the year and month and using that as an argument to the DATE function. In addition, we are either subtracting or adding one month to the result of the EXTEND. The final result will be to give us the order number, the original order date, the first of the month prior to the order date, and the first of the month following the order date. 19

20 I m still having trouble with dates Much of what you will need to do has already been done before. A few more examples 20 If you are unable to work it out through testing, and documentation and Google searches aren t turning up what you need, don t hesitate to ask the community. Most of us enjoy a challenge, but please remember to do your homework first. If you haven t already read the Smart Questions FAQ, it will help you to pose a question that will get you the best possible answer - See: 20

21 Select n rows - How do you get just a few? Query the database: SELECT <select clause> FROM <data source> WHERE <condition> 21 21

22 But I only want Putting limits on the rows returned from a SELECT Select-clause Keywords New features in IDS v10.00xc

23 FIRST, MIDDLE, LAST? SKIP offset (IDS v10.00.xc3) FIRST max LIMIT max (synonym for FIRST - IDSv10.00.xC3) MIDDLE max (XPS only) 23 23

24 FIRST/LIMIT Requires use of a max value SELECT FIRST 10 sales_reps, total_sales FROM sales ORDER BY total_sales DESC Restrictions View Nested SELECT Subqueries Others 24 LIMIT, introduced with IDSv10.00xC3 is a synonym for FIRST. 24

25 MIDDLE Available with XPS only Requires use of a max value Syntax and restrictions the same as for FIRST 25 25

26 SKIP Requires use of an offset value SELECT SKIP 50 col1, col2 FROM table1 SELECT SKIP 50 FIRST 10 col1, col2 FROM table1 Restrictions similar to FIRST 26 26

27 User-Defined Routines & SPL Distinction between routines and functions CURRENT Dynamic SPL 27 27

28 What s the difference? Procedures May accept arguments Does not return values Can not be used in SQL expressions Functions May accept arguments Returns one or more values Can be used in SQL expressions 28 Note - because procedures do not return values, they cannot be used in an SQL expression. 28

29 Why doesn t the time change? CURRENT Returns the date/time the routine was started Standard behavior - it isn t a bug 29 29

30 Can I use dynamic SPL? No! Not be default, anyway. exec bladelet (IDS v9.x) IBM DeveloperWorks ibm.com/developerworks/db2/zones/informix/library/samples/db_downloads.ht ml 30

31 Query Estimates What does that query estimate really mean? Compare estimates between modified versions of the same statement How is the query estimate determined? It depends on who you ask 31 Discussion. For more, see John Miller III sessions and Chat with the Lab presentations for a comprehensive discussion. 31

32 Newlines How do you remove newlines in text? "tr -d '\015'" C program Others? 32 Discussion. There are many suggested methods of removing newlines from text. There are a number of solutions provided at comp.databases.informix. 32

33 Resources IBM Informix manuals on-line IIUG SIGs (Special Interest Groups) Google

34 Session L04 Common SQL Questions: Why and How-to June C. Hunt Tyler Technologies Inc., MUNIS Division

Informix SQL Using New SQL Features

Informix SQL Using New SQL Features Informix SQL Using New SQL Features Jeff Filippi Integrated Data Consulting, LLC Session B01 Monday April 23 9:30am Introduction 21 years of working with Informix products 17 years as an Informix DBA Worked

More information

Microsoft SQL Server 2008: T-SQL Fundamentals Old Errata

Microsoft SQL Server 2008: T-SQL Fundamentals Old Errata Microsoft SQL Server 2008: T-SQL Fundamentals Old Errata Last modified: 2012-10-22 Note: If you have a later printing of this book, it may already contain the below corrections. Date / By Where 08 Robert

More information

The Year argument can be one to four digits between 1 and Month is a number representing the month of the year between 1 and 12.

The Year argument can be one to four digits between 1 and Month is a number representing the month of the year between 1 and 12. The table below lists all of the Excel -style date and time functions provided by the WinCalcManager control, along with a description and example of each function. FUNCTION DESCRIPTION REMARKS EXAMPLE

More information

Today s Experts. Mastering Dates Using SEQUEL 1. Technical Consultant. Technical Consultant

Today s Experts. Mastering Dates Using SEQUEL 1. Technical Consultant. Technical Consultant Today s Experts Steven Spieler Vivian Hall Technical Consultant Technical Consultant Mastering Dates Using SEQUEL 1 Mastering Dates Using SEQUEL Mastering Dates Using SEQUEL 2 Working with dates on the

More information

Tips for Reducing Formula Size

Tips for Reducing Formula Size Tips for Reducing Formula Size Salesforce, Summer 17 @salesforcedocs Last updated: August 9, 2017 Copyright 2000 2017 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com,

More information

Principles of Data Management

Principles of Data Management Principles of Data Management Alvin Lin August 2018 - December 2018 Structured Query Language Structured Query Language (SQL) was created at IBM in the 80s: SQL-86 (first standard) SQL-89 SQL-92 (what

More information

Lab # 4. Data Definition Language (DDL)

Lab # 4. Data Definition Language (DDL) Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 4 Data Definition Language (DDL) Eng. Haneen El-Masry November, 2014 2 Objective To be familiar with

More information

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2.

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2. Class #10: Understanding Primitives and Assignments Software Design I (CS 120): M. Allen, 19 Sep. 18 Java Arithmetic } Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = 2 + 5 / 2; 3.

More information

Unit 4. Scalar Functions and Arithmetic

Unit 4. Scalar Functions and Arithmetic Unit 4. Scalar Functions and Arithmetic What This Unit Is About Scalar functions can be used to manipulate column or expression values. This unit will discuss the format and syntax of basic scalar functions.

More information

3. Getting data out: database queries. Querying

3. Getting data out: database queries. Querying 3. Getting data out: database queries Querying... 1 Queries and use cases... 2 The GCUTours database tables... 3 Project operations... 6 Select operations... 8 Date formats in queries... 11 Aggregates...

More information

TutorTrac for Staff LOGINS: Kiosk Login Setting up the Kiosk for Student Login:

TutorTrac for Staff LOGINS: Kiosk Login Setting up the Kiosk for Student Login: LOGINS: TutorTrac for Staff Kiosk Login Setting up the Kiosk for Student Login: Click on the TutorTrac icon: This goes to http://tutortrac.davenport.edu (or type in the URL, if the shortcut is not available).

More information

Writing Your First Common Table Expression with SQL Server

Writing Your First Common Table Expression with SQL Server Writing Your First Common Table Expression with SQL Server Day 2 of Common Table Expression Month (June) at SteveStedman.com, today I will cover creating your very first CTE. Keep in mind that this may

More information

FIT 100 More Microsoft Access and Relational Databases Creating Views with SQL

FIT 100 More Microsoft Access and Relational Databases Creating Views with SQL FIT 100 More Microsoft Access and Relational Databases Creating Views with SQL Creating Views with SQL... 1 1. Query Construction in SQL View:... 2 2. Use the QBE:... 5 3. Practice (use the QBE):... 6

More information

Full file at

Full file at David Kroenke's Database Processing: Fundamentals, Design and Implementation (10 th Edition) CHAPTER TWO INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) True-False Questions 1. SQL stands for Standard

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Course 20761A: Querying Data with Transact SQL Course details Course Outline Module 1: Introduction to Microsoft SQL Server 2016 This module introduces SQL Server, the versions of SQL Server, including

More information

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama

Lab # 2. Data Definition Language (DDL) Eng. Alaa O Shama The Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Database Lab Lab # 2 Data Definition Language (DDL) Eng. Alaa O Shama October, 2015 Objective To be familiar

More information

Teradata SQL Features Overview Version

Teradata SQL Features Overview Version Table of Contents Teradata SQL Features Overview Version 14.10.0 Module 0 - Introduction Course Objectives... 0-4 Course Description... 0-6 Course Content... 0-8 Module 1 - Teradata Studio Features Optimize

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information

Querying Microsoft SQL Server

Querying Microsoft SQL Server Querying Microsoft SQL Server 20461D; 5 days, Instructor-led Course Description This 5-day instructor led course provides students with the technical skills required to write basic Transact SQL queries

More information

Variables, Data Types, and Arithmetic Expressions Learning Objectives:

Variables, Data Types, and Arithmetic Expressions Learning Objectives: Variables, Data Types, and Arithmetic Expressions Learning Objectives: Printing more than one variable in one printf() Printing formatting characters in printf Declaring and initializing variables A couple

More information

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials

Fundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals

More information

Querying Microsoft SQL Server

Querying Microsoft SQL Server Querying Microsoft SQL Server Course 20461D 5 Days Instructor-led, Hands-on Course Description This 5-day instructor led course is designed for customers who are interested in learning SQL Server 2012,

More information

CSC-140 Assignment 6

CSC-140 Assignment 6 CSC-140 Assignment 6 1 Introduction In this assignment we will start out defining our own classes. For now, we will design a class that represents a date, e.g., Tuesday, March 15, 2011, or in short hand

More information

WEEK 3 TERADATA EXERCISES GUIDE

WEEK 3 TERADATA EXERCISES GUIDE WEEK 3 TERADATA EXERCISES GUIDE The Teradata exercises for this week assume that you have completed all of the MySQL exercises, and know how to use GROUP BY, HAVING, and JOIN clauses. The quiz for this

More information

Advanced SQL Tribal Data Workshop Joe Nowinski

Advanced SQL Tribal Data Workshop Joe Nowinski Advanced SQL 2018 Tribal Data Workshop Joe Nowinski The Plan Live demo 1:00 PM 3:30 PM Follow along on GoToMeeting Optional practice session 3:45 PM 5:00 PM Laptops available What is SQL? Structured Query

More information

Why Jan 1, 1960? See:

Why Jan 1, 1960? See: 1 Why Jan 1, 1960? See: http://support.sas.com/community/newsletters/news/insider/dates.html Tony Barr was looking for a timestamp that would pre-date most electronic records that were available in the

More information

The DDE Server plugin PRINTED MANUAL

The DDE Server plugin PRINTED MANUAL The DDE Server plugin PRINTED MANUAL DDE Server plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying,

More information

2) SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules. Answer: TRUE Diff: 2 Page Ref: 36

2) SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules. Answer: TRUE Diff: 2 Page Ref: 36 Database Processing, 12e (Kroenke/Auer) Chapter 2: Introduction to Structured Query Language (SQL) 1) SQL stands for Standard Query Language. Diff: 1 Page Ref: 32 2) SQL includes a data definition language,

More information

Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke

Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke Test Bank for Database Processing Fundamentals Design and Implementation 13th Edition by Kroenke Link full download: https://testbankservice.com/download/test-bank-fordatabase-processing-fundamentals-design-and-implementation-13th-edition-bykroenke

More information

The Scheduler & Hotkeys plugin PRINTED MANUAL

The Scheduler & Hotkeys plugin PRINTED MANUAL The Scheduler & Hotkeys plugin PRINTED MANUAL Scheduler & Hotkeys plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including

More information

Information Science 1

Information Science 1 Topics covered Information Science 1 Terms and concepts from Week 8 Simple calculations Documenting programs Simple Calcula,ons Expressions Arithmetic operators and arithmetic operator precedence Mixed-type

More information

20461: Querying Microsoft SQL Server 2014 Databases

20461: Querying Microsoft SQL Server 2014 Databases Course Outline 20461: Querying Microsoft SQL Server 2014 Databases Module 1: Introduction to Microsoft SQL Server 2014 This module introduces the SQL Server platform and major tools. It discusses editions,

More information

COGS 121 HCI Programming Studio. Week 03 - Tech Lecture

COGS 121 HCI Programming Studio. Week 03 - Tech Lecture COGS 121 HCI Programming Studio Week 03 - Tech Lecture Housekeeping Assignment #1 extended to Monday night 11:59pm Assignment #2 to be released on Tuesday during lecture Database Management Systems and

More information

4010/5010 Transition: FAQs from Ask the Experts Webinars (Updated 2/15/12)

4010/5010 Transition: FAQs from Ask the Experts Webinars (Updated 2/15/12) 4010/5010 Transition: FAQs from Ask the Experts Webinars (Updated 2/15/12) Question: We are coming across clients who are avoiding upgrading their practice management software because they say their third-party

More information

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter 4. Basic SQL. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Basic SQL Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries

More information

Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center)

Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center) Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center) System Phone Number 578-6618 Help Desk Phone Number 631-4868 (6:00 a.m. 4:30 p.m.) Write your Access number here Write

More information

RDBMS- Day 4. Grouped results Relational algebra Joins Sub queries. In today s session we will discuss about the concept of sub queries.

RDBMS- Day 4. Grouped results Relational algebra Joins Sub queries. In today s session we will discuss about the concept of sub queries. RDBMS- Day 4 Grouped results Relational algebra Joins Sub queries In today s session we will discuss about the concept of sub queries. Grouped results SQL - Using GROUP BY Related rows can be grouped together

More information

Querying Data with Transact-SQL

Querying Data with Transact-SQL Course 20761A: Querying Data with Transact-SQL Page 1 of 5 Querying Data with Transact-SQL Course 20761A: 2 days; Instructor-Led Introduction The main purpose of this 2 day instructor led course is to

More information

Provider: MySQLAB Web page:

Provider: MySQLAB Web page: Provider: MySQLAB Web page: www.mysql.com Installation of MySQL. Installation of MySQL. Download the mysql-3.3.5-win.zip and mysql++-.7.--win3-vc++.zip files from the mysql.com site. Unzip mysql-3.3.5-win.zip

More information

20761 Querying Data with Transact SQL

20761 Querying Data with Transact SQL Course Overview The main purpose of this course is to give students a good understanding of the Transact-SQL language which is used by all SQL Server-related disciplines; namely, Database Administration,

More information

AVANTUS TRAINING PTE LTD

AVANTUS TRAINING PTE LTD [MS20461]: Querying Microsoft SQL Server 2014 Length : 5 Days Audience(s) : IT Professionals Level : 300 Technology : SQL Server Delivery Method : Instructor-led (Classroom) Course Overview This 5-day

More information

The Direct Excel Connection plugin PRINTED MANUAL

The Direct Excel Connection plugin PRINTED MANUAL The Direct Excel Connection plugin PRINTED MANUAL Direct Excel Connection plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical,

More information

A variable should be added to the Action Flow, where you can bind it to one of the Recorder Variables and set its value and other properties.

A variable should be added to the Action Flow, where you can bind it to one of the Recorder Variables and set its value and other properties. Variables Using Variables from Action Library you can assign the following values to Recorder variables: Random value, Constant value, Expression result. Actions Library Actions Description How to Use

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 4-3 Objectives This lesson covers the following objectives: Demonstrate the use of SYSDATE and date functions State the implications for world businesses to be able to easily

More information

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement

GIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement GIFT Department of Computing Science [Spring 2013] CS-217: Database Systems Lab-2 Manual Data Selection and Filtering using the SELECT Statement V1.0 4/12/2016 Introduction to Lab-2 This lab reinforces

More information

DB2 9 for z/os Selected Query Performance Enhancements

DB2 9 for z/os Selected Query Performance Enhancements Session: C13 DB2 9 for z/os Selected Query Performance Enhancements James Guo IBM Silicon Valley Lab May 10, 2007 10:40 a.m. 11:40 a.m. Platform: DB2 for z/os 1 Table of Content Cross Query Block Optimization

More information

Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761)

Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761) Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761) Course Length: 3 days Course Delivery: Traditional Classroom Online Live MOC on Demand Course Overview The main purpose of this

More information

MIS NETWORK ADMINISTRATOR PROGRAM

MIS NETWORK ADMINISTRATOR PROGRAM NH107-7475 SQL: Querying and Administering SQL Server 2012-2014 136 Total Hours 97 Theory Hours 39 Lab Hours COURSE TITLE: SQL: Querying and Administering SQL Server 2012-2014 PREREQUISITE: Before attending

More information

T-SQL Training: T-SQL for SQL Server for Developers

T-SQL Training: T-SQL for SQL Server for Developers Duration: 3 days T-SQL Training Overview T-SQL for SQL Server for Developers training teaches developers all the Transact-SQL skills they need to develop queries and views, and manipulate data in a SQL

More information

Objectives Reading SAS Data Sets and Creating Variables Reading a SAS Data Set Reading a SAS Data Set onboard ia.dfwlax FirstClass Economy

Objectives Reading SAS Data Sets and Creating Variables Reading a SAS Data Set Reading a SAS Data Set onboard ia.dfwlax FirstClass Economy Reading SAS Data Sets and Creating Variables Objectives Create a SAS data set using another SAS data set as input. Create SAS variables. Use operators and SAS functions to manipulate data values. Control

More information

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas

SQL Functionality SQL. Creating Relation Schemas. Creating Relation Schemas SQL SQL Functionality stands for Structured Query Language sometimes pronounced sequel a very-high-level (declarative) language user specifies what is wanted, not how to find it number of standards original

More information

Querying Microsoft SQL Server 2008/2012

Querying Microsoft SQL Server 2008/2012 Querying Microsoft SQL Server 2008/2012 Course 10774A 5 Days Instructor-led, Hands-on Introduction This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL

More information

Chapter 8 Relational Tables in Microsoft Access

Chapter 8 Relational Tables in Microsoft Access Chapter 8 Relational Tables in Microsoft Access Objectives This chapter continues exploration of Microsoft Access. You will learn how to use data from multiple tables and queries by defining how to join

More information

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: https://users.wpi.edu/~sjarvis/ece2049_smj/ We will come around checking your pre-labs

More information

SQL: Data Definition Language

SQL: Data Definition Language SQL: Data Definition Language CSC 343 Winter 2018 MICHAEL LIUT (MICHAEL.LIUT@UTORONTO.CA) DEPARTMENT OF MATHEMATICAL AND COMPUTATIONAL SCIENCES UNIVERSITY OF TORONTO MISSISSAUGA Database Schemas in SQL

More information

DECISION CONTROL AND LOOPING STATEMENTS

DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL STATEMENTS Decision control statements are used to alter the flow of a sequence of instructions. These statements help to jump from one part of

More information

Querying Microsoft SQL Server

Querying Microsoft SQL Server 20461 - Querying Microsoft SQL Server Duration: 5 Days Course Price: $2,975 Software Assurance Eligible Course Description About this course This 5-day instructor led course provides students with the

More information

The MODBUS RTU/ASCII, MODBUS/TCP plugin PRINTED MANUAL

The MODBUS RTU/ASCII, MODBUS/TCP plugin PRINTED MANUAL The MODBUS RTU/ASCII, MODBUS/TCP plugin PRINTED MANUAL MODBUS RTU/ASCII, MODBUS/TCP plugin All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic,

More information

Creating A Simple Calendar in PHP

Creating A Simple Calendar in PHP Creating A Simple Calendar in PHP By In this tutorial, we re going to look at creating calendars in PHP. In this first part of the series we build a simple calendar for display purposes, looking at the

More information

Instructor: Craig Duckett. Lecture 11: Thursday, May 3 th, Set Operations, Subqueries, Views

Instructor: Craig Duckett. Lecture 11: Thursday, May 3 th, Set Operations, Subqueries, Views Instructor: Craig Duckett Lecture 11: Thursday, May 3 th, 2018 Set Operations, Subqueries, Views 1 MID-TERM EXAM GRADED! Assignment 2 is due LECTURE 12, NEXT Tuesday, May 8 th in StudentTracker by MIDNIGHT

More information

Student Success Center Arithmetic Study Guide for the ACCUPLACER (CPT)

Student Success Center Arithmetic Study Guide for the ACCUPLACER (CPT) Fractions Terms Numerator: which tells how many parts you have (the number on top) Denominator: which tells how many parts in the whole (the number on the bottom) is parts have a dot out of Proper fraction:

More information

How to Request Courses (First Phase: Course Requests Lottery)

How to Request Courses (First Phase: Course Requests Lottery) How to Request Courses (First Phase: Course Requests Lottery) A two-week registration period where you may request up to three courses. It is the first of two registration phases. If you re unfamiliar

More information

ADDITIONAL EXCEL FUNCTIONS

ADDITIONAL EXCEL FUNCTIONS ADDITIONAL EXCEL FUNCTIONS The following notes and exercises on additional Excel functions are based on the Grade 12 Examination Guidelines for 2016 recently issued by the DBE. As such, they represent

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 7: SQL Ian Stark School of Informatics The University of Edinburgh Tuesday 7 February 2017 Semester 2 Week 4 https://blog.inf.ed.ac.uk/da17 Homework from Friday 1.

More information

Accuplacer Arithmetic Study Guide

Accuplacer Arithmetic Study Guide Accuplacer Arithmetic Study Guide I. Terms Numerator: which tells how many parts you have (the number on top) Denominator: which tells how many parts in the whole (the number on the bottom) Example: parts

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

Chapter 7. Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel 1 In this chapter, you will learn: The basic commands

More information

June Time Administrator - Change work schedule via SAP (Manager's Desktop)

June Time Administrator - Change work schedule via SAP (Manager's Desktop) Time Administrator - Change work schedule via SAP (Manager's Desktop) 1. Log on to Manager s Desktop Transaction Code: PPMDT Casual processing is entered via Manager s Desktop. You will need to add the

More information

Configuring Cisco Access Policies

Configuring Cisco Access Policies CHAPTER 11 This chapter describes how to create the Cisco Access Policies assigned to badge holders that define which doors they can access, and the dates and times of that access. Once created, access

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 6 Basic SQL Slide 6-2 Chapter 6 Outline SQL Data Definition and Data Types Specifying Constraints in SQL Basic Retrieval Queries in SQL INSERT, DELETE, and UPDATE Statements in SQL Additional Features

More information

Using Custom Number Formats

Using Custom Number Formats APPENDIX B Using Custom Number Formats Although Excel provides a good variety of built-in number formats, you may find that none of these suits your needs. This appendix describes how to create custom

More information

SQL functions fit into two broad categories: Data definition language Data manipulation language

SQL functions fit into two broad categories: Data definition language Data manipulation language Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition Chapter 7 Beginning Structured Query Language (SQL) MDM NUR RAZIA BINTI MOHD SURADI 019-3932846 razia@unisel.edu.my

More information

INTRODUCTION TO MYSQL MySQL : It is an Open Source RDBMS Software that uses Structured Query Language. It is available free of cost. Key Features of MySQL : MySQL Data Types: 1. High Speed. 2. Ease of

More information

framessp2015.notebook February 09, 2015

framessp2015.notebook February 09, 2015 To look at frames we are going to look at the examples under XHTML. http://www.pgrocer.net/cis44/cis44sampxhtml.html and scroll down to frames. 1 I have established a frameset (notice I did this instead

More information

QUERYING MICROSOFT SQL SERVER COURSE OUTLINE. Course: 20461C; Duration: 5 Days; Instructor-led

QUERYING MICROSOFT SQL SERVER COURSE OUTLINE. Course: 20461C; Duration: 5 Days; Instructor-led CENTER OF KNOWLEDGE, PATH TO SUCCESS Website: QUERYING MICROSOFT SQL SERVER Course: 20461C; Duration: 5 Days; Instructor-led WHAT YOU WILL LEARN This 5-day instructor led course provides students with

More information

Title. Syntax. stata.com. datetime business calendars creation Business calendars creation

Title. Syntax. stata.com. datetime business calendars creation Business calendars creation Title statacom datetime business calendars creation Business calendars creation Syntax Description Remarks and examples Also see Syntax Business calendar calname and corresponding display format %tbcalname

More information

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Relational Databases Fall 2017 Lecture 7

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Relational Databases Fall 2017 Lecture 7 SQL DATA DEFINITION: KEY CONSTRAINTS CS121: Relational Databases Fall 2017 Lecture 7 Data Definition 2 Covered most of SQL data manipulation operations Continue exploration of SQL data definition features

More information

Querying Microsoft SQL Server 2012/2014

Querying Microsoft SQL Server 2012/2014 Page 1 of 14 Overview This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL queries for Microsoft SQL Server 2014. This course is the foundation

More information

How to Register for Courses (Second Phase: Open Enrollment Registration)

How to Register for Courses (Second Phase: Open Enrollment Registration) How to Register for Courses (Second Phase: Open Enrollment Registration) During Open Enrollment you may register for any course that is not yet full, or be put onto a waitlist for a course that is full.

More information

SQL - Tables. SQL - Create a SQL Table. SQL Create Table Query:

SQL - Tables. SQL - Create a SQL Table. SQL Create Table Query: SQL - Tables Data is stored inside SQL tables which are contained within SQL databases. A single database can house hundreds of tables, each playing its own unique role in th+e database schema. While database

More information

Informatics 1: Data & Analysis

Informatics 1: Data & Analysis Informatics 1: Data & Analysis Lecture 3: The Relational Model Ian Stark School of Informatics The University of Edinburgh Tuesday 24 January 2017 Semester 2 Week 2 https://blog.inf.ed.ac.uk/da17 Lecture

More information

CS121 MIDTERM REVIEW. CS121: Relational Databases Fall 2017 Lecture 13

CS121 MIDTERM REVIEW. CS121: Relational Databases Fall 2017 Lecture 13 CS121 MIDTERM REVIEW CS121: Relational Databases Fall 2017 Lecture 13 2 Before We Start Midterm Overview 3 6 hours, multiple sittings Open book, open notes, open lecture slides No collaboration Possible

More information

SQL*Loader Concepts. SQL*Loader Features

SQL*Loader Concepts. SQL*Loader Features 6 SQL*Loader Concepts This chapter explains the basic concepts of loading data into an Oracle database with SQL*Loader. This chapter covers the following topics: SQL*Loader Features SQL*Loader Parameters

More information

Slicing and Dicing Data in CF and SQL: Part 2

Slicing and Dicing Data in CF and SQL: Part 2 Slicing and Dicing Data in CF and SQL: Part 2 Charlie Arehart Founder/CTO Systemanage carehart@systemanage.com SysteManage: Agenda Slicing and Dicing Data in Many Ways Cross-Referencing Tables (Joins)

More information

FIGURING OUT WHAT MATTERS, WHAT DOESN T, AND WHY YOU SHOULD CARE

FIGURING OUT WHAT MATTERS, WHAT DOESN T, AND WHY YOU SHOULD CARE FIGURING OUT WHAT MATTERS, WHAT DOESN T, AND WHY YOU SHOULD CARE CONTENTFAC.COM As an FYI, this document is designed to go along with our video by the same name. If you haven t checked that out yet, you

More information

Chapter 3 Introduction to relational databases and MySQL

Chapter 3 Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL Murach's PHP and MySQL, C3 2014, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Use phpmyadmin to review the data and structure of

More information

RMS Report Designing

RMS Report Designing RMS Report Designing RMS Report Writing Examples for designing custom report in RMS by RMS Support Center RMS uses the Report Builder report writing tool to allow users to design customized Reports using

More information

Information Science 1

Information Science 1 Information Science 1 Simple Calcula,ons Week 09 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 8 l Simple calculations Documenting

More information

Database Systems CSE 303. Lecture 02

Database Systems CSE 303. Lecture 02 Database Systems CSE 303 Lecture 02 2016 Structure Query Language (SQL) 1 Today s Outline (mainly from chapter 2) SQL introduction & Brief History Relational Model Data in SQL Basic Schema definition Keys

More information

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management Tenth Edition Chapter 7 Introduction to Structured Query Language (SQL) Objectives In this chapter, students will learn: The basic commands and

More information

Database Systems CSE 303. Lecture 02

Database Systems CSE 303. Lecture 02 Database Systems CSE 303 Lecture 02 2016 Structure Query Language (SQL) Today s Outline (mainly from chapter 2) SQL introduction & Brief History Relational Model Data in SQL Basic Schema definition Keys

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

Automating Information Lifecycle Management with

Automating Information Lifecycle Management with Automating Information Lifecycle Management with Oracle Database 2c The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated

More information

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance. 2.1 Introduction (No questions.) 2.2 A Simple Program: Printing a Line of Text 2.1 Which of the following must every C program have? (a) main (b) #include (c) /* (d) 2.2 Every statement in C

More information

CHAPTER4 CONSTRAINTS

CHAPTER4 CONSTRAINTS CHAPTER4 CONSTRAINTS LEARNING OBJECTIVES After completing this chapter, you should be able to do the following: Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN KEY,

More information

onecard Smart Data OnLine Getting Started Guide for Program Administrators

onecard Smart Data OnLine Getting Started Guide for Program Administrators Smart Data OnLine Getting Started Guide for Program Administrators Table of contents Introduction 3 Login 4 Company site configuration 6 Set-up Tasks 7 Creating a reporting structure 9 Cost allocation

More information

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

CMSC 201 Fall 2016 Lab 09 Advanced Debugging CMSC 201 Fall 2016 Lab 09 Advanced Debugging Assignment: Lab 09 Advanced Debugging Due Date: During discussion Value: 10 points Part 1: Introduction to Errors Throughout this semester, we have been working

More information

Data Definition Language with mysql. By Kautsar

Data Definition Language with mysql. By Kautsar Data Definition Language with mysql By Kautsar Outline Review Create/Alter/Drop Database Create/Alter/Drop Table Create/Alter/Drop View Create/Alter/Drop User Kautsar -2 Review Database A container (usually

More information

Course Outline and Objectives: Database Programming with SQL

Course Outline and Objectives: Database Programming with SQL Introduction to Computer Science and Business Course Outline and Objectives: Database Programming with SQL This is the second portion of the Database Design and Programming with SQL course. In this portion,

More information

Slicing and Dicing Data in CF and SQL: Part 1

Slicing and Dicing Data in CF and SQL: Part 1 Slicing and Dicing Data in CF and SQL: Part 1 Charlie Arehart Founder/CTO Systemanage carehart@systemanage.com SysteManage: Agenda Slicing and Dicing Data in Many Ways Handling Distinct Column Values Manipulating

More information