ITEC212 Database Management Systems Laboratory 2
|
|
- Jason McKenzie
- 6 years ago
- Views:
Transcription
1 ITEC212 Database Management Systems Laboratory 2 Aim: To learn how to use Single Row Functions and other important functions. In this handout we will learn about the single row functions that are used on a single row at a time. These functions are very useful and are used very often in the select and where clause of the select statement and also in the insert and delete commands of SQL as well as the PL/SQL procedures. Below is a list of some of the single row functions that are used more frequently. CHARACTER FUNCTIONS LOWER(column expression) Converts each letter to lowercase. UPPER(column expression) Converts each letter to uppercase. INITCAP(column expression) First character of each word is converted to uppercase and the rest to lowercase. CONCAT(column1 expression1,column2 expression2) Concatenates (joins) the first column or expression to the second one. Equivalent to the concatenate operator ( ). SUBSTR(column expression,m[,n]) Returns the specified n characters from position m of the column or expression. If n is not specified all characters from mth position until the end of the string are returned. LENGTH(column expression) Returns the number of characters in the column or expression. NVL(column1 expression1, value) Returns the first value if it is NOT NULL and the second value if the first one is NULL. NVL2(column1 expression1, notnullvalue, nullvalue) Checks for null as well as not null values. If the column has a not null value, the second parameter is displayed. If the column has a null value, the third parameter is displayed. RTRIM(column expr,c) Removes the blanks on the right hand side. LTRIM(column expr,c) Removes the blanks on the left hand side. Example 1: a) Display the job followed by name of each employee in department 30. The job should be in all lower case and the name should be in initial capitalization. SQL> SELECT LOWER(JOB_ID), INITCAP(LAST_NAME),DEPARTMENT_ID b) Display the job and name as a single column called EMPLOYEES. The job should be in all lower case, the name should be in initial capitalization and department should be in all upper case, SQL> SELECT UPPER(JOB_ID) ' ' INITCAP(LAST_NAME) EMPLOYEES,UPPER(DEPARTMENT_ID) Example 2: Display all information on all employees whose name contains the substring 'LA' starting from the second position. SQL> SELECT LAST_NAME WHERE SUBSTR(LAST_NAME,2,2) = 'LA';
2 DUAL table: The DUAL table is a special one-row, one-column table present by default in Oracle and other database installations. In Oracle, the table has a single VARCHAR2(1) column called DUMMY that has a value of 'X'. It is suitable for use in selecting a pseudo column such as SYSDATE or USER. Dual table can be also used to display the outcome of any character and number functions or an arithmetic expression. NUMBER FUNCTIONS ROUND(column expression,n) Rounds the column or expression to n decimal places. If n is omitted it is assumed to be 0. If n is negative numbers to the left of the decimal points are rounded. TRUNC(column expression,n) Truncates the column or expression to n decimal places. If n is omitted it is assumed to be 0. If n is negative numbers to the left of the decimal points are truncated to zero. MOD(m,n) Returns remainder of m divided by n. Example 3: SQL> SELECT ROUND( ,-1), ROUND( ,0), ROUND( ,2) FROM DUAL; ROUND ( ,-1) ROUND( ,0) ROUND( ,2) Example 4: SQL> SELECT TRUNC( ,3), TRUNC( ,0), TRUNC( ,-1) FROM DUAL; TRUNC( ,3) TRUNC( ,0) TRUNC( ,-1) Database stores dates as numbers therefore some arithmetic operations are allowed on dates. A date value contains the time values as well therefore you can find out the exact time an operation took place. OPERATION RESULT DESCRIPTION DATE + NUMBER : Date Adds a number of days to a date. DATE - NUMBER : Date Subtracts a number of days from a date. DATE1 - DATE2 : Number of days (Subtracts one date from another date) DATE + NUMBER / 24 Date Adds a number of hours to a date Example 5: Find the name and number of years each employee has been employed for. SQL> SELECT LAST_NAME, ROUND((SYSDATE-HIRE_DATE)/365) ; Example 6: Find the name and number of days each employee has been employed. SQL> SELECT LAST_NAME, (SYSDATE-HIRE_DATE) ;
3 Example 7: Find the name, number of days and number of weeks each employee has been employed. Department number should be 30 and employee name should be initial capitalization. SQL> SELECT INITCAP(LAST_NAME), (SYSDATE-HIRE_DATE) NUMBER OF DAYS, (SYSDATE- HIRE_DATE)/7 NUMBER OF WEEKS DATE FUNCTIONS SYSDATE: Returns the current date and time in a DATE datatype. CURRENT_DATE: Returns the current date and time in a DATE datatype. CURRENT_TIMESTAMP: Returns the current date and time in a TIMESTAMP datatype. MONTHS_BETWEEN(date1,date2): Finds the number of months between date1 and date2. The result is negative if date1 is before date2. ADD_MONTHS(date,n) : Adds n number of months to the month field of the date. NEXT_DAY(date,'char') : Finds the date of next day of the week that is represented by 'char' (ex: Monday) LAST_DAY(date) : Finds the date of the last day of the month that contains the date. EXTRACT: Returns component of a date/time expression. (ex: select extract(day from sysdate) from dual); ROUND(date [, 'fmt' ]) : Rounds a date to a format model specified by fmt (format). Fmt can be year or months etc. If fmt is not specified the date is set to midnight and returns the date. TRUNC(date [, 'fmt' ]) : If fmt is YEAR it returns the date of the first day of the year containing this date. If fmt is not specified, it finds the date of first day of the month containing the date. Example 8: Find the hiredate, last day of months and the date of the next Friday after the hiredate for all employees who work for department number 30. SQL> SELECT HIRE_DATE, LAST_DAY(HIRE_DATE), NEXT_DAY(HIRE_DATE,'FRIDAY') Example 9: SQL> SELECT ROUND(HIRE_DATE,'MONTH), ROUND(HIRE_DATE,'YEAR'), ROUND(HIRE_DATE,'DAY') WHERE LAST_NAME='KING'; ROUND(HIREDATE,'MONTH) ROUND(HIREDATE,'YEAR') ROUND(HIREDATE,'DAY') 01-DEC JAN NOV-81 CONVERTION FUNCTIONS TO_CHAR(number date [, 'fmt' ]) Converts a nuimber of date to a varchar2 character string with format fmt. TO_NUMBER(char) Converts a character string containing digits to number TO_DATE(char [, 'fmt' ]) Converts a character string representing a date value according to the fmt specified. If fmt is omitted, format is DD-MON-YY
4 SOME VALID DATE FORMATS YYYY,YYY,YY,Y: Four-digit year. Last 3,2,1 digits in the year. YEAR: Year spelled out. MM: 2 digit representation of MONTH. MONTH: Month name spelled out. MON: Month name abbreviated. DDD,DD,D: Day of year, month week. DAY: Day of week spelled out. DY: Day of week abbreviated. FM: Returns value with no leading or trailing blanks. Ex: SQL> select to_char(sysdate, 'DAY') 2 from dual; TO_CHAR(SYSDATE,'DAY') FRIDAY SQL> select length(to_char(sysdate, 'DAY')),length(to_char(sysdate, 'fmday')) 2 from dual LENGTH(TO_CHAR(SYSDATE,'DAY')) LENGTH(TO_CHAR(SYSDATE,'FMDAY')) (BLANKS REMOVED) SUFFIXES FOR DISPLAYING NUMBERS TH Ordinal number (DDTH for 5th) SP Spelled out number (DDSP for FIFTH) Example 10: Display the hiredate of KING with everything spelled out. SQL> SELECT LAST_NAME, TO_CHAR(HIREDATE,.'FMDAY' "of" DDSP MONTH YEAR') WHERE UPPER(LAST_NAME)='KING'; ENAME HIREDATE KING TUESDAY of SEVENTEENTH NOVEMBER NINETEEN EIGHTYONE Exercises: 1. Display the concatenation of employees last name and salary (separated by comma) under the column heading "EMPLOYEES AND THEIR SALARIES ". 2. Display the last name, hiredate, salary and salary increased by 10% for each employee. Label the new column NEW SALARY. 3. Display the full name, salary and add a column that subtracts the old salary from the new salary. Label the column INCREASE. 4. Display the first name and last name of employees whose first name contain N in the last second character. 5. For each employee, display the employee s last name and calculate the number of months between today and the date the employee was hired. Label the column MONTHS_WORKED. Order your results by the number of months employed. Round the number of months up to the closest whole number.
5 6. Display the first name and salary of all employees in the following format: <employee_name> earns $<employee_salary> but wants $<3* employee_salary> Label the column Dream Salaries. 7. Display each employee s last name, hire date and salary review date, which is the first Monday after six months of service. Label the column REVIEW. Format the dates to appear in the format similar to Monday, the Thirty-First of October, Display the last name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the week starting with Monday. 9. Find the date 30 days from now. 10. Write a query that displays the employees last names and commission amounts. If an employee does not earn commission, put No Commission. Label the column COMM. 11. Display first name and last name of employees who were hired in the month of MAY. Display the date in the following format: 31 st of OCT 2016, Monday 12. Display first name, last name and department id of employees who were hired after the 100th day of the year. 13. Display first name and last name of employees who were hired before Find the date of next Monday after 3 months from now. 15. What is the last day of the current month?
GIFT Department of Computing Science. [Spring 2016] CS-217: Database Systems. Lab-3 Manual. Single Row Functions in SQL
GIFT Department of Computing Science [Spring 2016] CS-217: Database Systems Lab-3 Manual Single Row Functions in SQL V3.0 4/26/2016 Introduction to Lab-3 Functions make the basic query block more powerful,
More informationDatabase Programming with SQL 5-1 Conversion Functions. Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Database Programming with SQL 5-1 Objectives This lesson covers the following objectives: Provide an example of an explicit data-type conversion and an implicit data-type conversion Explain why it is important,
More informationUnit 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 informationDatabase 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 informationSQL. - single row functions - Database Design ( 데이터베이스설계 ) JUNG, Ki-Hyun ( 정기현 )
SQL Database Design ( 데이터베이스설계 ) - single row functions - JUNG, Ki-Hyun ( 정기현 ) 1 SQL Functions Input Function Output Function performs action that defined already before execution 2 Two Types of SQL Functions
More informationConversion Functions
Conversion Functions Data type conversion Implicit data type conversion Explicit data type conversion 3-1 Implicit Data Type Conversion For assignments, the Oracle server can automatically convert the
More informationTO_CHAR Function with Dates
TO_CHAR Function with Dates TO_CHAR(date, 'fmt ) The format model: Must be enclosed in single quotation marks and is case sensitive Can include any valid date format element Has an fm element to remove
More informationSQL Structured Query Language Introduction
SQL Structured Query Language Introduction Rifat Shahriyar Dept of CSE, BUET Tables In relational database systems data are represented using tables (relations). A query issued against the database also
More informationGIFT 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 informationMANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 3 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA
More informationNone of the techniques used till now allows display of data from a after some arithmetic has been done it. Computations may include displaying
None of the techniques used till now allows display of data from a after some arithmetic has been done it. Computations may include displaying employee salary from the Employee_Master table along with
More informationOracle Database: SQL Fundamentals I. Oracle Internal & Oracle Academy Use Only. Volume II Student Guide. D64258GC10 Edition 1.0 January 2010 D65028
D64258GC10 Edition 1.0 January 2010 D65028 Oracle Database: SQL Fundamentals I Volume II Student Guide Authors Salome Clement Brian Pottle Puja Singh Technical Contributors and Reviewers Anjulaponni Azhagulekshmi
More informationCS2 Current Technologies Lecture 2: SQL Programming Basics
T E H U N I V E R S I T Y O H F R G E D I N B U CS2 Current Technologies Lecture 2: SQL Programming Basics Dr Chris Walton (cdw@dcs.ed.ac.uk) 4 February 2002 The SQL Language 1 Structured Query Language
More informationBraindumps.1z QA
Braindumps.1z0-061.75.QA Number: 1z0-061 Passing Score: 800 Time Limit: 120 min File Version: 19.1 http://www.gratisexam.com/ Examcollection study guide is the best exam preparation formula. The Dump provides
More informationTopic 8 Structured Query Language (SQL) : DML Part 2
FIT1004 Database Topic 8 Structured Query Language (SQL) : DML Part 2 Learning Objectives: Use SQL functions Manipulate sets of data Write subqueries Manipulate data in the database References: Rob, P.
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL
More informationRelational Database Language
DATA BASE MANAGEMENT SYSTEMS Unit IV Relational Database Language: Data definition in SQL, Queries in SQL, Insert, Delete and Update Statements in SQL, Views in SQL, Specifying General Constraints as Assertions,
More informationRETRIEVING DATA USING THE SQL SELECT STATEMENT
RETRIEVING DATA USING THE SQL SELECT STATEMENT Course Objectives List the capabilities of SQL SELECT statements Execute a basic SELECT statement Development Environments for SQL Lesson Agenda Basic SELECT
More informationOracle SQL. Revision Notes
Oracle SQL Revision Notes 1 - Oracle Server, technology and the relational paradigm. 2 - Data retrieval using the select statement. 3 - Restricting and sorting data. 4 - Single row functions. 5 - Using
More informationUnit 6. Scalar Functions
Unit 6. Scalar Functions What This Unit Is About This unit provides information on how to use various common scalar functions. What You Should Be Able to Do After completing this unit, you should be able
More informationUsing the Set Operators. Copyright 2006, Oracle. All rights reserved.
Using the Set Operators Objectives After completing this lesson, you should be able to do the following: Describe set operators Use a set operator to combine multiple queries into a single query Control
More informationExam Questions 1Z0-051
Exam Questions 1Z0-051 Oracle Database: SQL Fundamentals I https://www.2passeasy.com/dumps/1z0-051/ 1. - (Topic 1) Which statements are correct regarding indexes? (Choose all that apply.) A. For each data
More informationIntroduction to Functions and Variables
Introduction to Functions and Variables Functions are a way to add additional elements into your OBI Report. They enable you to manipulate data, perform computations and comparisons, and get system information.
More informationRMS 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 informationPractical Workbook Database Management Systems
Practical Workbook Database Management Systems Name : Year : Batch : Roll No : Department: Third Edition Reviewed in 2014 Department of Computer & Information Systems Engineering NED University of Engineering
More informationDatabase Programming - Section 1. Instructor Guide
Database Programming - Section 1 Instructor Guide Table of Contents...1 Lesson 1 - Case and Character Manipulation...1 What Will I Learn?...2 Why Learn It?...3...4 Try It / Solve It...10 Lesson 2 - Number
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
More informationLab # 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 informationDatabases - 5. Problems with the relational model Functions and sub-queries
Databases - 5 Problems with the relational model Functions and sub-queries Problems (1) To store information about real life entities, we often have to cut them up into separate tables Problems (1) To
More informationDownloaded from
UNIT 3 CHAPTER 13: DATABASE FUNDAMENTALS - MYSQL REVISION TOUR Database: Collection of logically related data stored in a structure format. DBMS: Software used to manage databases is called Data Base Management
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
More informationLab # 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 informationTop 10 SAS Functions in A brief summary of SAS Communities Survey - by Flora Fang Liu
Top 10 SAS Functions in 2017 A brief summary of SAS Communities Survey - by Flora Fang Liu 1 What are SAS Functions? Why use SAS Functions? What? SAS functions perform computations, data manipulation,
More informationChapter-14 SQL COMMANDS
Chapter-14 SQL COMMANDS What is SQL? Structured Query Language and it helps to make practice on SQL commands which provides immediate results. SQL is Structured Query Language, which is a computer language
More informationDatabase Foundations. 6-4 Data Manipulation Language (DML) Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Database Foundations 6-4 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control
More informationWhat are temporary tables? When are they useful?
What are temporary tables? When are they useful? Temporary tables exists solely for a particular session, or whose data persists for the duration of the transaction. The temporary tables are generally
More information1 SQL Structured Query Language
1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following
More information2. Programming written ( main theme is to test our data structure knowledge, proficiency
ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms
More informationORACLE Job Placement Paper. Paper Type : General - other
ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms
More informationReporting Functions & Operators
Functions Reporting Functions & Operators List of Built-in Field Functions Function Average Count Count Distinct Maximum Minimum Sum Sum Distinct Return the average of all values within the field. Return
More informationWelcome to Top 10 SAS Functions
Welcome to Top 10 SAS Functions Goal and Agenda By the end of this meeting, you will understand 10 key SAS functions purpose, value and features. What are SAS functions? Why use them? Use Case Manipulating
More informationSYSTEM CODE COURSE NAME DESCRIPTION SEM
Course: CS691- Database Management System Lab PROGRAMME: COMPUTER SCIENCE & ENGINEERING DEGREE:B. TECH COURSE: Database Management System Lab SEMESTER: VI CREDITS: 2 COURSECODE: CS691 COURSE TYPE: Practical
More informationAdditional Practice Solutions
Additional Practice Solutions Additional Practices Solutions The following exercises can be used for extra practice after you have discussed the data manipulation language (DML) and data definition language
More informationchapter 2 G ETTING I NFORMATION FROM A TABLE
chapter 2 Chapter G ETTING I NFORMATION FROM A TABLE This chapter explains the basic technique for getting the information you want from a table when you do not want to make any changes to the data and
More informationCOSC 304 Lab 5 Week of October 22, 2018
COSC 304 Lab 5 Week of October 22, 2018 Objectives: Working with Functions Due 30 minutes before your lab period in two weeks (Week of November 5) Use string manipulation functions LENGTH(), UPPER(), LOWER(),
More informationDatabase Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Database Foundations 6-3 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control
More information1 SQL Structured Query Language
1 SQL Structured Query Language 1.1 Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following
More informationSome Basic Aggregate Functions FUNCTION OUTPUT The number of rows containing non-null values The maximum attribute value encountered in a given column
SQL Functions Aggregate Functions Some Basic Aggregate Functions OUTPUT COUNT() The number of rows containing non-null values MIN() The minimum attribute value encountered in a given column MAX() The maximum
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 2-3 Objectives This lesson covers the following objectives: Define data type and explain why it is needed List and describe categories of data types Give examples of scalar
More informationThe Newest Certifytools 1Z0-061 Dumps! 100% Pass Guarantee! (339 Q&As) Oracle. Exam Questions 1Z0-061
Oracle Exam Questions 1Z0-061 Oracle Database 12c SQL Fundamentals NEW QUESTION 1 Which create table statement is valid? A. Option A B. Option B C. Option C D. Option D Answer: D Explanation: PRIMARY KEY
More informationDatabase implementation Further SQL
IRU SEMESTER 2 January 2010 Semester 1 Session 2 Database implementation Further SQL Objectives To be able to use more advanced SQL statements, including Renaming columns Order by clause Aggregate functions
More informationTestpassport.
Testpassport http://www.testpassport.cn Exam : 1Z0-051 Title : Oracle Database: SQL Fundamentals I Version : DEMO 1 / 11 1. View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS,
More informationDUE: 9. Create a query that will return the average order total for all Global Fast Foods orders from January 1, 2002, to December 21, 2002.
CIS 207 Oracle - Database Programming and SQL HOMEWORK: # 10 DUE: Run the following queries in Oracle Application Express. Paste a copy of each query Into this word document below the questions or notepad.txt
More informationCS Week 10 - Page 1
CS 425 Week 10 Reading: 1. Silberschatz, Krth & Sudarshan, Chapter 3.2 3.5 Objectives: 1. T learn mre abut SQL Functins used in queries. Cncepts: 1. SQL Functins Outline: SQL Functins Single rw functins
More informationINDEX. 1 Basic SQL Statements. 2 Restricting and Sorting Data. 3 Single Row Functions. 4 Displaying data from multiple tables
INDEX Exercise No Title 1 Basic SQL Statements 2 Restricting and Sorting Data 3 Single Row Functions 4 Displaying data from multiple tables 5 Creating and Managing Tables 6 Including Constraints 7 Manipulating
More informationLab # 6. Using Subqueries and Set Operators. Eng. Alaa O Shama
The Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Database Lab Lab # 6 Using Subqueries and Set Operators Eng. Alaa O Shama November, 2015 Objectives:
More informationCreating and Managing Tables Schedule: Timing Topic
9 Creating and Managing Tables Schedule: Timing Topic 30 minutes Lecture 20 minutes Practice 50 minutes Total Objectives After completing this lesson, you should be able to do the following: Describe the
More informationRDBMS Using Oracle. BIT-4 Lecture Week 3. Lecture Overview
RDBMS Using Oracle BIT-4 Lecture Week 3 Lecture Overview Creating Tables, Valid and Invalid table names Copying data between tables Character and Varchar2 DataType Size Define Variables in SQL NVL and
More informationTHE INDIAN COMMUNITY SCHOOL, KUWAIT
THE INDIAN COMMUNITY SCHOOL, KUWAIT SERIES : II MID TERM /FN/ 18-19 CODE : M 065 TIME ALLOWED : 2 HOURS NAME OF STUDENT : MAX. MARKS : 50 ROLL NO. :.. CLASS/SEC :.. NO. OF PAGES : 3 INFORMATICS PRACTICES
More informationSQL. Char (30) can store ram, ramji007 or 80- b
SQL In Relational database Model all the information is stored on Tables, these tables are divided into rows and columns. A collection on related tables are called DATABASE. A named table in a database
More informationAn Illustrative Approach to Use SQL Functions: A Review
An Illustrative Approach to Use SQL Functions: A Review Kamalinder Kaur Assistant Professor Chandigarh Engineering College Punjab, India Abstract This paper describes the function used in databases for
More informationSQL is an English like language consisting of commands to store, retrieve, maintain & regulate access to your database.
SQL SQL is an English like language consisting of commands to store, retrieve, maintain & regulate access to your database. SQL*Plus SQL*Plus is an application that recognizes & executes SQL commands &
More informationCS 275 Winter 2011 Problem Set 3
CS 275 Winter 2011 Problem Set 3 Run the following quires in Oracle Application Express where appropriate. Cut and paste your query for each applicable question. For short answer or multiple choice type
More informationPractical Workbook Database Management Systems
Practical Workbook Database Management Systems Name : Year : Batch : Roll No : Department: Department of Computer & Information Systems Engineering NED University of Engineering & Technology, Karachi 75270,
More informationData Definition Language (DDL)
Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113) Lab 6 Data Definition Language (DDL) Eng. Mohammed Alokshiya November 11, 2014 Database Keys A key
More informationSQL Structured Query Language (1/2)
Oracle Tutorials SQL Structured Query Language (1/2) Giacomo Govi IT/ADC Overview Goal: Learn the basic for interacting with a RDBMS Outline SQL generalities Available statements Restricting, Sorting and
More informationOracle Database SQL Basics
Oracle Database SQL Basics Kerepes Tamás, Webváltó Kft. tamas.kerepes@webvalto.hu 2015. február 26. Copyright 2004, Oracle. All rights reserved. SQL a history in brief The relational database stores data
More informationCS Reading Packet: "Simple Reports - Part 2"
CS 325 - Reading Packet: "Simple Reports - Part 2" p. 1 CS 325 - Reading Packet: "Simple Reports - Part 2" Sources: * Oracle9i Programming: A Primer, Rajshekhar Sunderraman, Addison Wesley. * Classic Oracle
More informationBsc (Hons) Software Engineering. Examinations for / Semester 1. Resit Examinations for BSE/15A/FT & BSE/16A/FT
Bsc (Hons) Software Engineering Cohort: BSE/16B/FT Examinations for 2017-2018 / Semester 1 Resit Examinations for BSE/15A/FT & BSE/16A/FT MODULE: DATABASE APPLICATION DEVELOPMENT MODULE CODE: DBT2113C
More informationWriting PL/SQL Executable Statements. Copyright 2007, Oracle. All rights reserved.
What Will I Learn? In this lesson, you will learn to: Construct accurate variable assignment statements in PL/SQL Construct accurate statements using built-in SQL functions in PL/SQL Differentiate between
More informationCS 252: Fundamentals of Relational Databases: SQL3
CS 252: Fundamentals of Relational Databases: SQL3 Dr. Alexandra I. Cristea http://www.dcs.warwick.ac.uk/~acristea/ Careful study of these notes is best left until most of the lectures on CS252 have been
More information2. In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years?
ORACLE Placement Papers 1. A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there
More informationGetting Information from a Table
ch02.fm Page 45 Wednesday, April 14, 1999 2:44 PM Chapter 2 Getting Information from a Table This chapter explains the basic technique of getting the information you want from a table when you do not want
More informationIntroduction to SQL. SQL is a standard language for accessing and manipulating databases. What is SQL?
Introduction to SQL SQL is a standard language for accessing and manipulating databases. What is SQL? SQL (Structured Query Language) is a standard interactive and programming language for getting information
More informationLecture 07. Spring 2018 Borough of Manhattan Community College
Lecture 07 Spring 2018 Borough of Manhattan Community College 1 SQL Identifiers SQL identifiers are used to identify objects in the database, such as table names, view names, and columns. The ISO standard
More informationcontent Character function Number Function Date Function Conversion Function
Function of SQL 1 content Character function Number Function Date Function Conversion Function 2 Character Function LOWER (col value) Select LOWER(dname), LOWER( SQL COURSE ) From DEPT LOWER (dname) research
More informationCS2 Current Technologies Note 1 CS2Bh
CS2 Current Technologies Note 1 Relational Database Systems Introduction When we wish to extract information from a database, we communicate with the Database Management System (DBMS) using a query language
More informationProgramming Languages
Programming Languages Chapter 19 - Continuations Dr. Philip Cannata 1 Exceptions (define (f n) (let/cc esc (/ 1 (if (zero? n) (esc 1) n)))) > (f 0) 1 > (f 2) 1/2 > (f 1) 1 > Dr. Philip Cannata 2 Exceptions
More informationDatabase Programming with SQL
Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to
More informationMaintaining Data 3.3.1
Maintaining Data Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 4.0.3 3.3.1 Unit Objectives After completing this unit, you should be able to: Create
More informationMANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 4 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA
More informationOracle Database 10g: Introduction to SQL
ORACLE UNIVERSITY CONTACT US: 00 9714 390 9000 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database
More informationSUPERKEY A superkey is a combination of attributes that can be used to uniquely identify a database record. A table might have many superkeys.
MCS 043 SYLLABUS: 1. EER Diagram 10 Marks 2. Normalization 15 Marks 3. SQL PL/SQL 20 Marks 4. Query Optimization 5 Marks 5. Class/UML & RDBMS 5 Marks 6. XML 5 Marks 7. OORDBMS 5 Marks 8. Transaction Management
More informationSQL FUNCTIONS. Prepared By:Dr. Vipul Vekariya.
SQL FUNCTIONS Prepared By:Dr. Vipul Vekariya. SQL FUNCTIONS Definition of Function Types of SQL Function Numeric Function String Function Conversion Function Date Function SQL Function Sub program of SQL
More informationA. It executes successfully and displays rows in the descending order of PROMO_CATEGORY.
Volume: 75 Questions Question No: 1 Evaluate the following SQL statement: Which statement is true regarding the outcome of the above query? A. It executes successfully and displays rows in the descending
More informationObjectives. After completing this lesson, you should be able to do the following:
Objectives After completing this lesson, you should be able to do the following: Describe the types of problems that subqueries can solve Define subqueries List the types of subqueries Write single-row
More informationManipulating Data. Copyright 2004, Oracle. All rights reserved.
Manipulating Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement
More informationRestricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.
Restricting and Sorting Data Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort
More informationRestricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.
Restricting and Sorting Data Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the rows that are retrieved by a query Use
More informationSELF TEST. List the Capabilities of SQL SELECT Statements
98 SELF TEST The following questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully because there might be more than one correct answer.
More informationDatabases - 3. Null, Cartesian Product and Join. Null Null is a value that we use when. Something will never have a value
Databases - 3, Cartesian Product and Join is a value that we use when Something will never have a value Something will have a value in the future Something had a value but doesn t at the moment is a reserved
More informationCOGS 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 informationDatabases - 3. Null, Cartesian Product and Join. Null Null is a value that we use when. Something will never have a value
Databases - 3 Null, Cartesian Product and Join Null Null is a value that we use when Something will never have a value Something will have a value in the future Something had a value but doesn t at the
More informationCOSC344 Database Theory and Applications. Lecture 5 SQL - Data Definition Language. COSC344 Lecture 5 1
COSC344 Database Theory and Applications Lecture 5 SQL - Data Definition Language COSC344 Lecture 5 1 Overview Last Lecture Relational algebra This Lecture Relational algebra (continued) SQL - DDL CREATE
More informationDatatypes, Variables, and Operations
Datatypes, Variables, and Operations 1 Primitive Type Classification 2 Numerical Data Types Name Range Storage Size byte 2 7 to 2 7 1 (-128 to 127) 8-bit signed short 2 15 to 2 15 1 (-32768 to 32767) 16-bit
More informationUNIT III INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL)
UNIT III INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) 3.1Data types 3.2Database language. Data Definition Language: CREATE,ALTER,TRUNCATE, DROP 3.3 Database language. Data Manipulation Language: INSERT,SELECT,UPDATE,DELETE
More informationSQL DATA MANIPULATION. Prepared By: Dr. Vipul Vekariya.
SQL DATA MANIPULATION Prepared By: Dr. Vipul Vekariya. SQL DATA MANIPULATION SQL DATA TYPES CREATE CLAUSE SELECTCLAUSE ORDERED BY CLAUSE AS CLAUSE Basic Data Types of SQL CHAR NUMERIC VARCHAR/VARCHAR 2
More informationOracle Training. Introduction to Oracle
TRAINING WORKBOOK Oracle Training Confidential Business Information This documentation is proprietary information of SCT and is not to be copied, reproduced, lent or disposed of, nor used for any purpose
More informationUsing DDL Statements to Create and Manage Tables. Copyright 2006, Oracle. All rights reserved.
Using DDL Statements to Create and Manage Tables Objectives After completing this lesson, you should be able to do the following: Categorize the main database objects Review the table structure List the
More informationReference: W3School -
Language SQL SQL Adv Reference: W3School - http://www.w3schools.com/sql/default.asp http://www.tomjewett.com/dbdesign/dbdesign.php?page=recursive.php SQL Aliases SQL aliases are used to give a table, or
More information