27-2-20061DB opgaven 2 Opgaven 2 Geert-Jan Houben.

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model
Advertisements

Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 5: Other Relational.
CS 319: Theory of Databases: C4
SQL Database for a Book Store Clinton McKay. Explanation The database contains information about the books held in stock, their authors, publishers, customers,
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Review Session Monday, Oct 8 Shipra Agrawal. Announcements New Gradiance assignment deadline Wednesday, Oct 10 Please read FAQs for assignments.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Huiswerk Lees delen 3.2, 3.3 van hoofdstuk 3. opgaven voor hoofdstuk 2: modelleeropgave 5.
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C6.
DB Review Session. ER Diagrams 1 Where does the salary attribute belong? Actor id name address birthday Acted In Movie title type year salary.
COMP 3715 Spring 05. Working with data in a DBMS Any database system must allow user to  Define data Relations Attributes Constraints  Manipulate data.
1 Exercise 1  Given the following tables: employee (person_name, street, city)‏ works (person_name, company_name, salary)‏ company (company_name, city)‏
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Database Management Systems I Alex Coman, Winter 2006 Entity-Relationship.
Table design screen Field name Data type Field size Other properties.
SQL Structured Query Language Meizhen Huang. Content (4.1 – 4.4) Background Parts of SQL Basic Structure Set Operations Aggregate Functions.
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Query by example (based on notes by Silberchatz,Korth, and Sudarshan.
Table design screen Field name Data type Field size Other properties.
SQL SQL stands for Structured Query Language SQL allows you to access a database SQL is an ANSI standard computer language SQL can execute queries against.
MySQL Tutorial (2) Introduction to Database. Banking Example branch (branch-name, branch-city, assets) customer (customer-name, customer-street, customer-city)
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Reduction of an E-R Schema to Tables A database which conforms to an E-R diagram can be represented.
N° 23 page 70page N° 24 page 70page N° 25 page 70page N° 26 page 70page N° 45 page 71page.
Interpreting SQL Code. SQL (The language used to query a database) S is used to specify the you want to include. F is used to specify the the selected.
Database I. Practice SQL.
© Scott/Jones Publishing, Inc. 1 Chapter 19 Advanced Features of List Management Excel 2003, Volume 2 by Karen J. Jolly.
1. 2 icoffey ****** 3 decimal numbers Sales.
Xin  Syntax ◦ SELECT field1 AS title1, field2 AS title2,... ◦ FROM table1, table2 ◦ WHERE conditions  Make a query that returns all records.
1 Computer Support Specialists and Systems Administrator.
It holds the book together. It also tells you the book’s title, author, publisher and call number.
Using someone else’s words as your own by: ≈ Directly copying from a book or other work ≈ “Cut and paste” from the Internet Use “quotation marks” around.
©2012 Microsoft Corporation. All rights reserved. Content based on SharePoint 15 Technical Preview and published July 2012.
DETERMINING AND PAYING THE PAYROLL
CS 101 – Nov. 9 Text software issues (continued) –Readability –Fonts Database concepts –Relationships –Queries.
0 Glencoe Accounting Unit 3 Chapter 13 Copyright © by The McGraw-Hill Companies, Inc. All rights reserved. Analyzing and Journalizing the Payroll After.
Relational Model Concepts. The relational model represents the database as a collection of relations. Each relation resembles a table of values. A table.
Unit 9 Federal Payroll and Tax Returns McGraw-Hill/Irwin Copyright © 2006 The McGraw-Hill Companies, Inc. All rights reserved.
How to Write a Bibliography Book: Author’s Last Name, First Name. Title. City of Publication: Publishing Company, Year. Example: Smith, John. Great Artists.
Chapter 3: Relational Model  Structure of Relational Databases  Normal forms (chap. 7)  Reduction of an E-R Schema to Relational (Sect. 2.9)  Relational.
Query Processing: Relational Algebra
CS 101 – Access notes Databases (Microsoft Access) 4 parts of a database database design –Try to understand the ideas behind database design, not just.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts DB Schema Design: the Entity-Relationship Model What’s the use of the E-R model? Entity Sets.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts - 5 th Edition, Oct 5, 2006 Example.
1Database Management Systems Exercise II  Consider the following relational schemas:  employee (person_name, street, city)  company (company_name, city)
View From Above Map ofFlag of …………………………………………………………………………………………………………………………………………
Relational Algebra Sample Questions.
More SQL Statements To Modify Tables. Library Database Books ISBN bkTitle bkPrice pubID Publishers pubID pubName pubPhone Authors auID auName auPone Books/Authors.
Title Page The title page is the first page in the book. It tells you the title of the book, the author and the illustrator. It also tells you who published.
ASET Relational Algebra continues…. ASET Rename Operation Allows us to name, and therefore to refer to, the results of relational-algebra expressions.
Name: Ms. Weber.  ds/science-space-kids/solar-system-101-kids/
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com 3 SQL.
COMM 470 Week 4 DQ 3 Check this A+ tutorial guideline at 470-Week-4-DQ-3 Your company is planning to open.
Session 3 Welcome: To session 3-the fourth learning sequence
Learning Objectives Today we will Learn:
COP Introduction to Database Structures
Comparison Operators Relational Operators.
E-R Diagram (Cont.) Draw ER Diagram for the following scenario:
Relational Algebra - Select & Project
APA Brochure Citation.
Presentation Title Your company information.
Presentation Title Your company information.
Chapter 2: Intro to Relational Model
Presentation Title Here
Generalization.
Database Systems 10/13/2010 Lecture #4.
Information needed for citing sources:
Entity-Relationship Model
Bookstore DB Requirements
Relational Algebra Sample Questions.
Introduction to Database
How to transfer information into your science fair log books.
Presentation transcript:

DB opgaven 2 Opgaven 2 Geert-Jan Houben

Pag DB opgaven 2 Example employee (person-name, street, city) works (person-name, company-name, salary) company (company-name, city) manages (person-name, manager-name)

Pag DB opgaven a. Give all employees of First Bank Corporation a 10 percent salary raise. b. Give all managers in this database a 10 percent salary raise, unless the salary would be greater than $100,000. In such cases, give only a 3 percent raise. c. Delete all tuples in the works relation for employees of Small Bank Corporation.

Pag DB opgaven Using the bank example, write relational-algebra queries to find the accounts held by more than two customers in the following ways: a. Using an aggregate function. b. Without using any aggregate functions.

Pag DB opgaven a. Find the company with the most employees. b. Find the company with the smallest payroll. c. Find those companies whose employees earn a higher salary, on average, than the average salary at First Bank Corporation.

Pag DB opgaven employee(empno, name, office, age) books(isbn, title, authors, publisher) loan(empno, isbn, date) a. Find the names of employees who have borrowed a book published by McGraw-Hill. b. Find the names of employees who have borrowed all books published by McGraw-Hill. c. Find the names of employees who have borrowed more than five different books published by McGraw-Hill. d. For each publisher, find the names of employees who have borrowed more than five books of that publisher.