Practice for Test 1 (not counted for credit, but to help you prepare) Time allowed: 1 hour 15 minutes

Size: px
Start display at page:

Download "Practice for Test 1 (not counted for credit, but to help you prepare) Time allowed: 1 hour 15 minutes"

Transcription

1 p.1 of 8 INFS 4240/6240 (Section A) Database Management System Fall 2018 Practice for Test 1 (not counted for credit, but to help you prepare) Time allowed: 1 hour 15 minutes Q.1(a) Q.1(b) Q.1(c) Q.1(d) Q.1(e) Q.1(f) Q.1(g) Q.2(a) Name: Sample Answers Q.2(b) Open Book, Open Notes, including web access. Consultation with other people not allowed. Answer all questions. Answer in the space provided. Please give a good effort to make your writing readable. Read each of the questions carefully before working on it. Q.2(c) 5 5 Total

2 p.2 of 8 Q.1 We have access to a simple personnel database for a certain company with 26 employees in 4 departments. The four departments are: Executive, Accounting, Sales, and Engineering. The personnel database consists of one table, with the schema illustrated in the following. Employee( EmpNo, EmpName, Dept, Gender, Salary ). The Employee table has 5 columns: EmpNo is a unique number to identify each employee and it constitutes the whole primary key; EmpName is the name of the employee; Dept is the name of the department the employee belongs to. (Every employee must belong to exactly one department, null value is not allowed.) Gender is the employee s gender: M for Male and F for Female; Salary is employee s salary in dollars and cents. Answer the following questions Q.1(a) to Q.1(g). [75 points total: (a) 15 points, (b) to (g) 10 points each.] Q.1(a) Write down an SQL statement to create the Employee table, with the constraints as specified above. You may also assume any reasonable use of datatypes, including these: Number for EmpNo, Text for EmpName and Dept, single character length text string for Gender and Currency or Number for Salary. Be sure to cover the required constraints as stated above. (15 points) CREATE TABLE Employee (EmpNo number Primary Key, EmpName text, Dept text not null, Gender char(1), Salary currency);

3 p.3 of 8 Q.1 We are provided with access to the database, both MS Access and Oracle. If you want to use MS Access, copy the file at P:\wu\DMT1\Q1Emp.accdb to your computer. The database contains the table Employee already populated with data for your use. If you use Oracle, sign on with SQL*Plus using your user-id@infs4240 and your password, refer to the table as wu.employee in your SQL statement. Q.1(b) Write an SQL statement to list all employees of the Accounting Department: list EmpNo and EmpName. List the result in alphabetical order by the Employee s Name. The SQL statement should make sure that the results listed contains no duplicate entries for any data situation. Write down the SQL statement below, along with the result you get from the SQL statement. (10 points). SELECT EmpNo, EmpName WHERE Dept = Accounting ORDER BY EmpName; Q1B EmpNo EmpName 22 Vincent 23 William 24 Xena 25 Yvonne 26 Zoe

4 p.4 of 8 Q.1(c) Write an SQL statement to determine the maximum salary paid to an employee. List just the salary amount. Write down the SQL statement below, along with the result from the SQL statement. (10 points) SELECT MAX(Salary) ; Q1C Expr1000 $140, Q.1(d) Knowing the maximum salary from Q1.(c) above, write the SQL statement to list all the employees at the maximum salary. List the employee s name (EmpName), and the department name (Dept), and the Salary. Write down the SQL statement below, along with the result from the SQL statement. (10 points) SELECT EmpName, Dept, Salary WHERE Salary = ; Or (if you may use a sub-query ) SELECT EmpName, Dept, Salary WHERE Salary = (Select MAX(Salary) from Employee); Q1D EmpName Dept Salary Aaron Executive $140, Charles Executive $140,000.00

5 p.5 of 8 Q.1(e) Write an SQL statement to determine the number of employees and the average salary in the Sales Department: list the number of employees and then the average salary together using one SQL statement. Write down the SQL statement, along with the result from the SQL statement. (10 points) SELECT Count(*), Avg(Salary) WHERE Dept = Sales ; Q1E Expr1000 Expr $49, Q.1(f) Write an SQL statement to list the number of employees, and the average salary for every department: list the department name (Dept), the number of employees, and the average salary. List the result in descending order of the average salary in the department. Write down the SQL statement below, and show the result from the SQL statement. (10 points) SELECT Dept, Count(*), Avg(Salary) GROUP BY Dept ORDER BY Avg(Salary) DESC; Dept Q1F Expr1001 Expr1002 Executive 4 $119, Engineering 7 $56, Accounting 5 $51, Sales 10 $49,500.00

6 p.6 of 8 Q.1(g) Write an SQL statement to list the number of employees, and the average salary for those departments in which average salary is higher than $55,000: list the department name (Dept), the number of employees, and the average salary. List the result in alphebetical order by the department name. Write down the SQL statement below, and show the result from the SQL statement. (10 points) SELECT Dept, Count(*), Avg(Salary) GROUP BY Dept HAVING Avg(Salary) > ORDER BY Dept ASC; Dept Q1G Count(*) Avg(Salary) Engineering 7 $56, Executive 4 $119,250.00

7 p.7 of 8 Q.2 In a certain small college summer program, each course offered in the 8 weeks summer program period meets once a week, Monday to Friday, and for 3 hours each period. The following table ASSIGNMENT keeps track of the classroom assignment for the courses. Each course is identified by course number CNum. Bldg and Room are the Building name and Room number respectively, indicating the classroom assigned to the course. Day specifies which day of the week the class meets. Each class meets for 3 hours. Note that StartTime must be 9am, 12noon, 3pm, or 6pm. Enroll specifies the number of students enrolled in the course. The following illustrates what the table may look like. ASSIGNMENT CNum Bldg Room Day StartTime Enroll 2150 Hale 302 WED 9am Hopeman 401 FRI 12noon Wheatley 119 TUE 3pm 22 Answer the questions Q2.(a),(b),(c) [25 points total: (a),(b) 10 points, (c) 5 points] Note that the SQL statements should be written for the schema, so that the statements should execute correctly with any possible data situation. The data shown in the above is for the purpose of illustration only. We should not need to have the database to write the SQL statements. Q.2(a) Write an SQL statement to list all the courses with classes meeting in Hale on Monday (MON) starting at 9am. List the course number (CNum), the room number (Room) for the class and the number of students enrolled (Enroll). Order the result by room number. Just write down the SQL statement; NO need to show data result. (The result would depend on the specific data situation. The SQL statement should work correctly according to the schema, and for any data situation.) (10 points) SELECT CNum, Room, Enroll FROM ASSIGNMENT WHERE Bldg = Hale AND Day = MON AND StartTime = 9am ORDER BY Room;

8 p.8 of 8 Q.2(b) A classroom must be able to accommodate the number of students as enrolled. Write an SQL statement to find the maximum number of students that may be in each classroom for any course in Hale center. List the room number (Room) and the maximum number of students (max of Enroll) that may be there, presenting the result order by room number. Write down just the SQL statement. (10 points) SELECT Room, max(enroll) FROM ASSIGNMENT WHERE Bldg = Hale GROUP BY Room ORDER BY Room; Q.2(c) The primary key for the ASSIGNMENT table has one column CNum. Find another candidate key for the table which may to used to serve as a secondary key. (NOTE: A candidate key for a table is a minimal collection of columns of the table such that no two rows in the table may have exact same data values under those columns, so that it may serve as key. It is a minimal collection because if we remove any column in the collection, it can no longer serve as a key.) (5 points) Another candidate key consists the following 4 columns: Bldg, Room, Day, StartTime Each row identifies a course (by its unique CNum); no two courses can meet in the same place at the same time. Therefore, no two rows will have same data values under these columns. More, the collection cannot be reduced in any way. SQL to create the table, using it as a Secondary Key CREATE TABLE ASSIGNMENT (CNum text Primary Key, Bldg text, Room number, Day text, StartTime text, Enroll number, Unique(Bldg,Room,Day,StartTime) ); Note then the table will NOT allow incorrect data entry to have two different courses mistakenly assigned a conflicting schedule class meeting at the same place and same time. The Secondary Key will prevent such insertion of data, with the error message Violation of Secondary Key constraint. - End -

Name: Sample Answers Q.2(c) 7 7

Name: Sample Answers Q.2(c) 7 7 p.1 of 11 INFS 4240 (Section B) Database Management Systems Fall 2017 Practice for Test 2 (not for credit, but to help you prepare) Time allowed: 1 hour 15 minutes Q.1(a) 12 12 Q.1(b) 10 10 Q.1(c) 10 10

More information

Name: Answers Q

Name: Answers Q p.1 of 10 INFS 4240/6240 (Section A) Database Management System Fall 2018 Test 3 December 4, 2018 2:00 3:15 pm Q.1-1 10 10 Q.1-2 8 8 Q.2 12 12 Name: Answers Q.3-1 6 6 Q.3-2 32 32 Q.3-3 32 32 Total 100

More information

Simple SQL. Peter Y. Wu. Dept of Computer and Information Systems Robert Morris University

Simple SQL. Peter Y. Wu. Dept of Computer and Information Systems Robert Morris University Simple SQL Peter Y. Dept of Computer and Information Systems Robert Morris University Simple SQL create table drop table insert into table values ( ) delete from table where update table set a to v where

More information

SQL. Char (30) can store ram, ramji007 or 80- b

SQL. 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 information

CS 582 Database Management Systems II

CS 582 Database Management Systems II Review of SQL Basics SQL overview Several parts Data-definition language (DDL): insert, delete, modify schemas Data-manipulation language (DML): insert, delete, modify tuples Integrity View definition

More information

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition)

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) ACS-3902 Fall 2016 Ron McFadyen 3D21 ron.mcfadyen@acs.uwinnipeg.ca Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition) 1 The Relational Data Model and Relational Database Constraints

More information

Click the Add a New Value Tab. Click Add. The system will populate the Event ID field with a number after the event request is saved.

Click the Add a New Value Tab. Click Add. The system will populate the Event ID field with a number after the event request is saved. How to login to SIS: SIS-only users go to: https://buckeyelink2.osu.edu/, click on Student Information System (main page), login using your lastname.# and password. Schedule an Event Path: Main Menu Campus

More information

RESTRICTING AND SORTING DATA

RESTRICTING AND SORTING DATA RESTRICTING AND SORTING DATA http://www.tutorialspoint.com/sql_certificate/restricting_and_sorting_data.htm Copyright tutorialspoint.com The essential capabilities of SELECT statement are Selection, Projection

More information

Insertions, Deletions, and Updates

Insertions, Deletions, and Updates Insertions, Deletions, and Updates Lecture 5 Robb T. Koether Hampden-Sydney College Wed, Jan 24, 2018 Robb T. Koether (Hampden-Sydney College) Insertions, Deletions, and Updates Wed, Jan 24, 2018 1 / 17

More information

DATABASE DEVELOPMENT (H4)

DATABASE DEVELOPMENT (H4) IMIS HIGHER DIPLOMA QUALIFICATIONS DATABASE DEVELOPMENT (H4) Friday 3 rd June 2016 10:00hrs 13:00hrs DURATION: 3 HOURS Candidates should answer ALL the questions in Part A and THREE of the five questions

More information

Why Relational Databases? Relational databases allow for the storage and analysis of large amounts of data.

Why Relational Databases? Relational databases allow for the storage and analysis of large amounts of data. DATA 301 Introduction to Data Analytics Relational Databases Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca DATA 301: Data Analytics (2) Why Relational Databases? Relational

More information

General Assignment Scheduling Compliance Dashboard Functional Documentation Latest update: 1/13/2016 by Wood Foster- Smith

General Assignment Scheduling Compliance Dashboard Functional Documentation Latest update: 1/13/2016 by Wood Foster- Smith General Assignment Scheduling Compliance Dashboard Functional Documentation Latest update: 1/13/2016 by Wood Foster- Smith Purpose The Office of the Registrar controls General Assignment (GA) classroom

More information

Computer Architecture and Engineering CS152 Quiz #2 March 7th, 2016 Professor George Michelogiannakis Name: <ANSWER KEY>

Computer Architecture and Engineering CS152 Quiz #2 March 7th, 2016 Professor George Michelogiannakis Name: <ANSWER KEY> Computer Architecture and Engineering CS152 Quiz #2 March 7th, 2016 Professor George Michelogiannakis Name: This is a closed book, closed notes exam. 80 Minutes. 15 pages Notes: Not all questions

More information

Database Management Systems,

Database Management Systems, Database Management Systems SQL Query Language (3) 1 Topics Aggregate Functions in Queries count sum max min avg Group by queries Set Operations in SQL Queries Views 2 Aggregate Functions Tables are collections

More information

CS 200 Fall 2012 Assignment 8 SQL Due Monday November 10 by 4:00 pm

CS 200 Fall 2012 Assignment 8 SQL Due Monday November 10 by 4:00 pm CS 200 Fall 2012 Assignment 8 SQL Due Monday November 10 by 4:00 pm Read Notes 6, in particular Database Design and Watcom SQL User s Guide. Please follow these instructions very carefully to find the

More information

Database Systems CSE 303. Outline. Lecture 06: SQL. What is Sub-query? Sub-query in WHERE clause Subquery

Database Systems CSE 303. Outline. Lecture 06: SQL. What is Sub-query? Sub-query in WHERE clause Subquery Database Systems CSE 303 Lecture 06: SQL 2016 Subquery Outline What is a Subquery Subquery in WHERE clause >ALL, >ANY, >=ALL,

More information

To understand the concept of candidate and primary keys and their application in table creation.

To understand the concept of candidate and primary keys and their application in table creation. CM0719: Database Modelling Seminar 5 (b): Candidate and Primary Keys Exercise Aims: To understand the concept of candidate and primary keys and their application in table creation. Outline of Activity:

More information

Testing Masters Technologies

Testing Masters Technologies 1. What is Data warehouse ETL TESTING Q&A Ans: A Data warehouse is a subject oriented, integrated,time variant, non volatile collection of data in support of management's decision making process. Subject

More information

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY Seat No.: Enrolment No. GUJARAT TECHNOLOGICAL UNIVERSITY BE - SEMESTER III (NEW) - EXAMINATION SUMMER 2017 Subject Code: 21303 Date: 02/06/2017 Subject Name: Database Management Systems Time: 10:30 AM

More information

ES I INFORMATICS PRACTICES Set I Class XII Sec- A,B,C Date: April 2017 Time: 1 hr 10 min M.M.: 30

ES I INFORMATICS PRACTICES Set I Class XII Sec- A,B,C Date: April 2017 Time: 1 hr 10 min M.M.: 30 ES I INFORMATICS PRACTICES Set I Class XII Sec- A,B,C Date: April 2017 Time: 1 hr 10 min M.M.: 30 Name Roll No. Instruction: a) Attempt all questions 1. a) Table Stud has 20 rows and 15 columns. Table

More information

SQL Functions (Single-Row, Aggregate)

SQL Functions (Single-Row, Aggregate) Islamic University Of Gaza Faculty of Engineering Computer Engineering Department Database Lab (ECOM 4113) Lab 4 SQL Functions (Single-Row, Aggregate) Eng. Ibraheem Lubbad Part one: Single-Row Functions:

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

Microsoft MOS- Using Microsoft Office Access Download Full Version :

Microsoft MOS- Using Microsoft Office Access Download Full Version : Microsoft 77-605 MOS- Using Microsoft Office Access 2007 Download Full Version : http://killexams.com/pass4sure/exam-detail/77-605 QUESTION: 120 Peter works as a Database Designer for AccessSoft Inc. The

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

Based on the following Table(s), Write down the queries as indicated: 1. Write an SQL query to insert a new row in table Dept with values: 4, Prog, MO

Based on the following Table(s), Write down the queries as indicated: 1. Write an SQL query to insert a new row in table Dept with values: 4, Prog, MO Based on the following Table(s), Write down the queries as indicated: 1. Write an SQL query to insert a new row in table Dept with values: 4, Prog, MO INSERT INTO DEPT VALUES(4, 'Prog','MO'); The result

More information

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data. Managing Data Data storage tool must provide the following features: Data definition (data structuring) Data entry (to add new data) Data editing (to change existing data) Querying (a means of extracting

More information

MySQL Creating a Database Lecture 3

MySQL Creating a Database Lecture 3 MySQL Creating a Database Lecture 3 Robb T Koether Hampden-Sydney College Mon, Jan 23, 2012 Robb T Koether (Hampden-Sydney College) MySQL Creating a DatabaseLecture 3 Mon, Jan 23, 2012 1 / 31 1 Multiple

More information

Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries

Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries Copyright 2004 Pearson Education, Inc. Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries Copyright 2004 Pearson Education, Inc. 1 Data Definition, Constraints, and Schema Changes Used

More information

Downloaded from

Downloaded from Lesson 16: Table and Integrity Constraints Integrity Constraints are the rules that a database must follow at all times. Various Integrity constraints are as follows:- 1. Not Null: It ensures that we cannot

More information

SQL Structured Query Language Introduction

SQL 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 information

What Are Group Functions? Reporting Aggregated Data Using the Group Functions. Objectives. Types of Group Functions

What Are Group Functions? Reporting Aggregated Data Using the Group Functions. Objectives. Types of Group Functions What Are Group Functions? Group functions operate on sets of rows to give one result per group. Reporting Aggregated Data Using the Group Functions Maximum salary in table Copyright 2004, Oracle. All rights

More information

Database Management Systems,

Database Management Systems, Database Management Systems SQL Query Language (2) 1 Topics Update Query Delete Query Integrity Constraint Cascade Deletes Deleting a Table Join in Queries Table variables More Options in Select Queries

More information

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement

Chapter 4. Basic SQL. SQL Data Definition and Data Types. Basic SQL. SQL language SQL. Terminology: CREATE statement Chapter 4 Basic SQL Basic SQL SQL language Considered one of the major reasons for the commercial success of relational databases SQL Structured Query Language Statements for data definitions, queries,

More information

Support Center. How do I enroll in a CITI course for the first time? Last Updated: May 20, :19AM EDT. Contact Us. Hours of Operation

Support Center. How do I enroll in a CITI course for the first time? Last Updated: May 20, :19AM EDT. Contact Us. Hours of Operation The purpose of the CITI Program Support Center is to provide technical support, resources, tips, and answers to frequently asked questions regarding the CITI Program. We welcome contributions and feedback

More information

download instant at The Relational Data Model

download instant at  The Relational Data Model 3 The Relational Data Model EXERCISES 3.1 Define data atomicity as it relates to the definition of relational databases. Contrast data atomicity with transaction atomicity as used in a transaction processing

More information

INDIAN SCHOOL MUSCAT FINAL TERM EXAMINATION INFORMATICS PRACTICES

INDIAN SCHOOL MUSCAT FINAL TERM EXAMINATION INFORMATICS PRACTICES Answer Key-Class XI INFO 017-18(Final) Roll Number Code Number 065/ INDIAN SCHOOL MUSCAT FINAL TERM EXAMINATION INFORMATICS PRACTICES CLASS: XII Sub. Code: 065 TimeAllotted:3 Hrs 18.0.018 Max. Marks: 70

More information

Introduction to Oracle9i: SQL

Introduction to Oracle9i: SQL Oracle 1z0-007 Introduction to Oracle9i: SQL Version: 22.0 QUESTION NO: 1 Oracle 1z0-007 Exam Examine the data in the EMPLOYEES and DEPARTMENTS tables. You want to retrieve all employees, whether or not

More information

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014 Aggregation Lecture 7 Section 5.1.7-5.1.8 Robb T. Koether Hampden-Sydney College Wed, Jan 29, 2014 Robb T. Koether (Hampden-Sydney College) Aggregation Wed, Jan 29, 2014 1 / 17 1 Aggregate Functions 2

More information

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment Introductory concepts of DBMS 1. Explain detailed 3-level architecture

More information

ADDING A NEW CLASS -- OR

ADDING A NEW CLASS -- OR ADDING A NEW CLASS A) If you want to add a new class for a course in a particular term and classes for that course already exist in that term, navigate to Maintain Schedule of Classes to add the new class.

More information

Kendriya Vidyalaya Sangathan (Chandigarh Region) Blue Print of Question Paper Class: XI Subject: Informatics Practices Session

Kendriya Vidyalaya Sangathan (Chandigarh Region) Blue Print of Question Paper Class: XI Subject: Informatics Practices Session Kendriya Vidyalaya Sangathan (Chandigarh Region) Blue Print of Question Paper Class: XI Subject: Informatics Practices Session 2017-18 S.No. Unit Very Short Answer Short Answer-I Short Answer-II Long Answer

More information

CSE414 Midterm Exam Spring 2018

CSE414 Midterm Exam Spring 2018 CSE414 Midterm Exam Spring 2018 May 4, 2018 Please read all instructions (including these) carefully. This is a closed-book exam. You are allowed one page of note sheets that you can write on both sides.

More information

Fundamentals of Database Systems

Fundamentals of Database Systems Fundamentals of Database Systems Assignment: 2 Due Date: 18th August, 2017 Instructions This question paper contains 10 questions in 6 pages. Q1: Consider the following schema for an office payroll system,

More information

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity COSC 416 NoSQL Databases Relational Model (Review) Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was proposed by E. F. Codd

More information

CS3DB3/SE4DB3/SE6M03 TUTORIAL

CS3DB3/SE4DB3/SE6M03 TUTORIAL CS3DB3/SE4DB3/SE6M03 TUTORIAL Mei Jiang Feb 13/15, 2013 Outline Relational Algebra SQL and Relational Algebra Examples Relational Algebra Basic Operators Select: C (R) where C is a list of conditions Project:

More information

Objectives. 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: 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 information

Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query

More information

TBD TA Office hours: Will be posted on elearning. SLO3: Students will demonstrate competency in data modeling, including dimensional modeling.

TBD TA Office hours: Will be posted on elearning. SLO3: Students will demonstrate competency in data modeling, including dimensional modeling. Course MIS 6309.002 Course Title Business Data Warehousing Professor Kashif Saeed Term Fall 2017 Meetings Wed 4:00pm 6:45pm; JSOM 2.722 Professor s Contact Information Office Phone (972) 883-5094 Other

More information

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints

WHAT IS SQL. Database query language, which can also: Define structure of data Modify data Specify security constraints SQL KEREM GURBEY WHAT IS SQL Database query language, which can also: Define structure of data Modify data Specify security constraints DATA DEFINITION Data-definition language (DDL) provides commands

More information

Release Two. For School Boards and School Authorities. November 2005 (Version 1.1)

Release Two. For School Boards and School Authorities. November 2005 (Version 1.1) MINISTRY OF EDUCATION Information Management Branch Ontario School Information System (OnSIS) User Guide: SIGNING-OFF A SUBMISSION Release Two For School Boards and School Authorities November 2005 (Version

More information

Course Registration Manual

Course Registration Manual Course Registration Manual Introduction Please keep the following points in mind when registering for courses. 1 Campusmate cannot be used between 3:00 AM and 5:00 AM (Japan Standard Time) each day. APU

More information

Advanced SQL GROUP BY Clause and Aggregate Functions Pg 1

Advanced SQL GROUP BY Clause and Aggregate Functions Pg 1 Advanced SQL Clause and Functions Pg 1 Clause and Functions Ray Lockwood Points: s (such as COUNT( ) work on groups of Instead of returning every row read from a table, we can aggregate rows together using

More information

Database Management Systems,

Database Management Systems, Database Management Systems Database Design (2) 1 Topics Data Base Design Logical Design (Review) Physical Design Entity Relationship (ER) Model to Relational Model Entity Relationship Attributes Normalization

More information

Chapter 6 Windowed Tables and Window Functions in SQL

Chapter 6 Windowed Tables and Window Functions in SQL Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 6 Windowed Tables and Window Functions in SQL Recent Developments

More information

Who, where, when. Database Management Systems (LIX022B05) Literature. Evaluation. Lab Sessions. About this course. After this course...

Who, where, when. Database Management Systems (LIX022B05) Literature. Evaluation. Lab Sessions. About this course. After this course... Who, where, when base Management Systems (LIX022B05) Instructor: Çağrı Çöltekin c.coltekin@rug.nl Information science/informatiekunde Fall 2012 Course bases (LIX022B05) 2012/13 Instructor Çağrı Çöltekin

More information

Guide to Providing Ongoing RTI Files (for your census files due to Mercer)

Guide to Providing Ongoing RTI Files (for your census files due to Mercer) Guide to Providing Ongoing RTI Files (for your census files due to Mercer) Provide any changes (i.e., eligible new hires, terminated employees, job class changes, salary changes etc.) to your ongoing census

More information

Exam: 1Z Title : Introduction to Oracle9i: SQL. Ver :

Exam: 1Z Title : Introduction to Oracle9i: SQL. Ver : Exam: 1Z0-007 Title : Introduction to Oracle9i: SQL Ver : 05.14.04 QUESTION 1 A: This query uses "+" to create outer join as it was in Oracle8i, but it requires also usage of WHERE clause in SELECT statement.b:

More information

Office of Planning & Analysis (OPA) Page 1 of 19 (02/06/2014)

Office of Planning & Analysis (OPA) Page 1 of 19 (02/06/2014) Office of Planning & Analysis (OPA) Page 1 of 19 (02/06/2014) KBOR Undergraduate Advising Survey Q1 Pursuing a degree Executed on 1/8/2013 Associate Bachelor Assoc & Bachelor not degree seeking 15 1,065

More information

Office of Planning & Analysis (OPA) Page 1 of 19 (08/28/2015)

Office of Planning & Analysis (OPA) Page 1 of 19 (08/28/2015) Office of Planning & Analysis (OPA) Page 1 of 19 (08/28/2015) KBOR Undergraduate Advising Survey Executed on 8/28/2015 Q1 Pursuing a degree Associate Bachelor Assoc & Bachelor not degree seeking 20 926

More information

DUE: 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.

DUE: 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 information

SQL. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior

SQL. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior SQL Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior 1 DDL 2 DATA TYPES All columns must have a data type. The most common data types in SQL are: Alphanumeric: Fixed length:

More information

You can write a command to retrieve specified columns and all rows from a table, as illustrated

You can write a command to retrieve specified columns and all rows from a table, as illustrated CHAPTER 4 S I N G L E - TA BL E QUERIES LEARNING OBJECTIVES Objectives Retrieve data from a database using SQL commands Use simple and compound conditions in queries Use the BETWEEN, LIKE, and IN operators

More information

Ten Great Reasons to Learn SAS Software's SQL Procedure

Ten Great Reasons to Learn SAS Software's SQL Procedure Ten Great Reasons to Learn SAS Software's SQL Procedure Kirk Paul Lafler, Software Intelligence Corporation ABSTRACT The SQL Procedure has so many great features for both end-users and programmers. It's

More information

Examination paper for TDT4145 Data Modelling and Database Systems

Examination paper for TDT4145 Data Modelling and Database Systems Department of Computer and Information Science Examination paper for TDT4145 Data Modelling and Database Systems Academic contact during examination: Svein Erik Bratsberg: 99539963 Roger Midtstraum: 99572420

More information

Sample Paper 2014 Class - XII Subject Informatics Practices (065)

Sample Paper 2014 Class - XII Subject Informatics Practices (065) Sample Paper 2014 Class - XII Subject Informatics Practices (065) Instructions: (i) All questions are compulsory (ii) Answer the questions after carefully reading the text. QA Answer the following questions:

More information

School of Computing, Engineering and Information Sciences University of Northumbria. Set Operations

School of Computing, Engineering and Information Sciences University of Northumbria. Set Operations Set Operations Aim: To understand how to do the equivalent of the UNION, DIFFERENCE and INTERSECT set operations in SQL. Outline of Session: Do some example SQL queries to learn to differentiate between

More information

IMPORTANT: Circle the last two letters of your class account:

IMPORTANT: Circle the last two letters of your class account: Fall 2001 University of California, Berkeley College of Engineering Computer Science Division EECS Prof. Michael J. Franklin FINAL EXAM CS 186 Introduction to Database Systems NAME: STUDENT ID: IMPORTANT:

More information

The SQL data-definition language (DDL) allows defining :

The SQL data-definition language (DDL) allows defining : Introduction to SQL Introduction to SQL Overview of the SQL Query Language Data Definition Basic Query Structure Additional Basic Operations Set Operations Null Values Aggregate Functions Nested Subqueries

More information

Chapter 9 Windowed Tables and Window Functions in SQL. Recent Development for Data Models 2016 Stefan Deßloch

Chapter 9 Windowed Tables and Window Functions in SQL. Recent Development for Data Models 2016 Stefan Deßloch Chapter 9 Windowed Tables and Window Functions in SQL Recent Development for Data Models 2016 Stefan Deßloch Windowed Table Functions Windowed table function operates on a window of a table returns a value

More information

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects.

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects. Set Theory Set theory is a branch of mathematics that studies sets. Sets are a collection of objects. Often, all members of a set have similar properties, such as odd numbers less than 10 or students in

More information

G64DBS Database Systems. G64DBS Module. Recommended Textbook. Assessment. Recommended Textbook. Recommended Textbook.

G64DBS Database Systems. G64DBS Module. Recommended Textbook. Assessment. Recommended Textbook. Recommended Textbook. G64DBS Database Systems Tim Brailsford G64DBS Module Lectures Mondays, 3pm in LT2 Fridays, 4pm in LT3 Labs - TBA Will NOT start until approximately Week 4 Wednesdays, 2-4pm in A32 Tim Brailsford (tjb@cs.nott.ac.uk)

More information

Scheduling. Scheduling Tasks At Creation Time CHAPTER

Scheduling. Scheduling Tasks At Creation Time CHAPTER CHAPTER 13 This chapter explains the scheduling choices available when creating tasks and when scheduling tasks that have already been created. Tasks At Creation Time The tasks that have the scheduling

More information

Step 1. Final Grade Roster Submission. IT Department Printed on 05/21/2012 Page 1. Steps to Submit Grades. Step 1. Step 2. Step 3

Step 1. Final Grade Roster Submission. IT Department Printed on 05/21/2012 Page 1. Steps to Submit Grades. Step 1. Step 2. Step 3 /Notes 1. Log into CUNYfirst Enter your username and password AND Click on the Go button icon 2. From the Enterprise Menu, select the HR/Campus Solutions link IT Department Printed on 05/21/2012 Page 1

More information

A. It executes successfully and displays rows in the descending order of PROMO_CATEGORY.

A. 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 information

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL

Chapter 3: Introduction to SQL. Chapter 3: Introduction to SQL Chapter 3: Introduction to SQL Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 3: Introduction to SQL Overview of The SQL Query Language Data Definition Basic Query

More information

SQL-99: Schema Definition, Basic Constraints, and Queries. Create, drop, alter Features Added in SQL2 and SQL-99

SQL-99: Schema Definition, Basic Constraints, and Queries. Create, drop, alter Features Added in SQL2 and SQL-99 SQL-99: Schema Definition, Basic Constraints, and Queries Content Data Definition Language Create, drop, alter Features Added in SQL2 and SQL-99 Basic Structure and retrieval queries in SQL Set Operations

More information

Exam : 1Z Title : Introduction to Oracle9i: SQL

Exam : 1Z Title : Introduction to Oracle9i: SQL Exam : 1Z0-007 Title : Introduction to Oracle9i: SQL Ver : 01-15-2009 QUESTION 1: Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20

More information

DRES STUDENT ACCESS AND ACCOMMODATION SYSTEM (SAAS) INTRODUCTION AND SUPPORT STUDENT RESOURCE GUIDE FOR SAAS 2.0

DRES STUDENT ACCESS AND ACCOMMODATION SYSTEM (SAAS) INTRODUCTION AND SUPPORT STUDENT RESOURCE GUIDE FOR SAAS 2.0 DRES STUDENT ACCESS AND ACCOMMODATION SYSTEM (SAAS) INTRODUCTION AND SUPPORT STUDENT RESOURCE GUIDE FOR SAAS 2.0 Dear CSUN Student, During the summer of 2014, DRES launched the Student Access and Accommodation

More information

Tutorial 1 Database: Introductory Topics

Tutorial 1 Database: Introductory Topics Tutorial 1 Database: Introductory Topics Theory Reference: Rob, P. & Coronel, C. Database Systems: Design, Implementation & Management, 6th Edition, 2004, Chapter 1. Review Questions 2 7, 9 10. Problems

More information

Structured Query Language (SQL)

Structured Query Language (SQL) Structured Query Language (SQL) SQL Chapters 6 & 7 (7 th edition) Chapters 4 & 5 (6 th edition) PostgreSQL on acsmysql1.acs.uwinnipeg.ca Each student has a userid and initial password acs!

More information

Downloaded from

Downloaded 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 information

Simple SQL Queries (contd.)

Simple SQL Queries (contd.) Simple SQL Queries (contd.) Example of a simple query on one relation Query 0: Retrieve the birthdate and address of the employee whose name is 'John B. Smith'. Q0: SELECT BDATE, ADDRESS FROM EMPLOYEE

More information

Getting Information from a Table

Getting 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 information

Quick Guide. Managing Existing Projects

Quick Guide. Managing Existing Projects Quick Guide Managing Existing Projects Managing existing Projects This quick guide gives an overview of important points in relation to managing existing projects. With ongoing projects, you may find that

More information

CLASS DISCUSSION AND NOTES

CLASS DISCUSSION AND NOTES Mon CLASS DISCUSSION AND NOTES October 2009 Tue Wed Thu Fri 19 20 21 22 23 AH-6; PBL & Project Peer Evaluations Chap. 7 SQL/DB Construction AH-6; PBL & Project Peer Evaluations Chap. 7 SQL/DB Construction

More information

Modern Database Systems Lecture 1

Modern Database Systems Lecture 1 Modern Database Systems Lecture 1 Aristides Gionis Michael Mathioudakis T.A.: Orestis Kostakis Spring 2016 logistics assignment will be up by Monday (you will receive email) due Feb 12 th if you re not

More information

CISN 340 Data Communication and Networking Fundamentals Fall 2012 (Hybrid)

CISN 340 Data Communication and Networking Fundamentals Fall 2012 (Hybrid) CISN 340 Data Communication and Networking Fundamentals Fall 2012 (Hybrid) Instructor: Kevin M. Anderson, MBA, CCAI, MCSE, MCDBA, Office Phone: (916) 650-2926 CNE, LCP, CIW Associate, Security+, N +, A

More information

SYSTEM CODE COURSE NAME DESCRIPTION SEM

SYSTEM 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 information

Oracle 1Z Oracle9i: Program with PL/SQL. Download Full Version :

Oracle 1Z Oracle9i: Program with PL/SQL. Download Full Version : Oracle 1Z0-147 Oracle9i: Program with PL/SQL Download Full Version : https://killexams.com/pass4sure/exam-detail/1z0-147 Answer: C QUESTION: 118 Which two describe a stored procedure? (Choose two.) A.

More information

Database Laboratory Note (MS SQL Server 2000)

Database Laboratory Note (MS SQL Server 2000) Database Laboratory Note MS SQL Server 2000 Creating a New Database using QA query analyzer In MS-SQL server 2000 a database can be considered as a container to the objects in a database. A database has

More information

CS145 Final Examination

CS145 Final Examination CS145 Final Examination Spring 2003, Prof. Widom ffl Please read all instructions (including these) carefully. ffl There are 11 problems on the exam, with a varying number of points for each problem and

More information

CS2300: File Structures and Introduction to Database Systems

CS2300: File Structures and Introduction to Database Systems CS2300: File Structures and Introduction to Database Systems Lecture 9: Relational Model & Relational Algebra Doug McGeehan 1 Brief Review Relational model concepts Informal Terms Formal Terms Table Relation

More information

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Administrivia. Administrivia. Faloutsos/Pavlo CMU /615

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Administrivia. Administrivia. Faloutsos/Pavlo CMU /615 Carnegie Mellon Univ. Dept. of Computer Science 15-415/615 - DB Applications C. Faloutsos A. Pavlo Lecture#14(b): Implementation of Relational Operations Administrivia HW4 is due today. HW5 is out. Faloutsos/Pavlo

More information

Database Programming - Section 18. Instructor Guide

Database Programming - Section 18. Instructor Guide Database Programming - Section 18 Instructor Guide Table of Contents...1 Lesson 1 - Certification Exam Preparation...1 What Will I Learn?...2 Why Learn It?...3 Tell Me / Show Me...4 Try It / Solve It...5

More information

KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS

KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS Chapter 1: Databases and Database Users 1. Define the following

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 Relational Databases: Tuples, Tables, Schemas, Relational Algebra Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) Overview

More information

Online Registration. CAPP courses are actual UW Oshkosh college courses!

Online Registration. CAPP courses are actual UW Oshkosh college courses! Online Registration By completing this process, you will be enrolling in these courses for college credit Grades are final and permanent on transcript As a UW Oshkosh student you must follow our policies,

More information

CPS221 Lecture: Relational Database Querying and Updating

CPS221 Lecture: Relational Database Querying and Updating CPS221 Lecture: Relational Database Querying and Updating last revised 8/5/10 Objectives: 1. To introduce the SQL select statement 2. To introduce the SQL insert, update, and delete statements Materials:

More information

Key Points. COSC 122 Computer Fluency. Databases. What is a database? Databases in the Real-World DBMS. Database System Approach

Key Points. COSC 122 Computer Fluency. Databases. What is a database? Databases in the Real-World DBMS. Database System Approach COSC 122 Computer Fluency Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) allow for easy storage and retrieval of large amounts of information. 2) Relational

More information

Comp 5311 Database Management Systems. 2. Relational Model and Algebra

Comp 5311 Database Management Systems. 2. Relational Model and Algebra Comp 5311 Database Management Systems 2. Relational Model and Algebra 1 Basic Concepts of the Relational Model Entities and relationships of the E-R model are stored in tables also called relations (not

More information