Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query.

Slides:



Advertisements
Similar presentations
SQL Query Examples Database Management COP4540, SCS, FIU.
Advertisements

Oracle Labs ECS 242, 342, 360 –You can connect from home to the machines in the lab. –E.g.: ssh u-knoppix.csc.uvic.ca Execute “sh” to use the proper shell.
Boyce-Codd NF Takahiko Saito Spring 2005 CS 157A.
SQL This presentation will cover: A Brief History of DBMS View in database MySQL installation.
Database Modifications CIS 4301 Lecture Notes Lecture /30/2006.
SQL reviews. Stored Procedures Create Procedure Triggers.
Algebraic and Logical Query Languages Spring 2011 Instructor: Hassan Khosravi.
Relational Algebra.
Midterm Review II. Redundancy. –Information may be repeated unnecessarily in several tuples. –E.g. length and filmType. Update anomalies. –We may change.
Database Modifications, Data Types, Views. Database Modifications A modification command does not return a result as a query does, but it changes the.
Database Modifications, Data Types, Views. Database Modifications A modification command does not return a result as a query does, but it changes the.
Subqueries Example Find the name of the producer of ‘Star Wars’.
Indexes. An index on an attribute A of a relation is a data structure that makes it efficient to find those tuples that have a fixed value for attribute.
Query Compiler By:Payal Gupta Roll No:106(225) Professor :Tsau Young Lin.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 8 A First Course in Database Systems.
SQL. 1.SQL is a high-level language, in which the programmer is able to avoid specifying a lot of data-manipulation details that would be necessary in.
CMSC424: Database Design Instructor: Amol Deshpande
Movies length titleyearfilmType Voices isa Cartoons isa MurderMystery weapon toStar Our Movie Example.
SQL SQL is a very-high-level language, in which the programmer is able to avoid specifying a lot of data-manipulation details that would be necessary in.
Database Modifications A modification command does not return a result as a query does, but it changes the database in some way. There are three kinds.
Joins Natural join is obtained by: R NATURAL JOIN S; Example SELECT * FROM MovieStar NATURAL JOIN MovieExec; Theta join is obtained by: R JOIN S ON Example.
The Query Compiler 16.1 Parsing and Preprocessing Meghna Jain(205) Dr. T. Y. Lin.
Bitmap Indexes.
SQL By: Toan Nguyen. Download Download the software at During the installation –Skip sign up for fast installation.
Chapter 6 The database Language SQL Spring 2011 Instructor: Hassan Khosravi.
Presentation Timer Select a time to count down from the clock above 60 min 45 min 30 min 20 min 15 min 10 min 5 min or less.
Presentation Timer Select a time to count down from the clock above 60 min 45 min 30 min 20 min 15 min 10 min 5 min or less.
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
ORDBS1 Object Relational Database Systems: 1. Introduction 2. Objects in SQL3 3. Comparison of ODL/OQL and SQL3 Approaches CIS 671.
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Introduction to Data Manipulation in SQL CIS 4301 Lecture Notes Lecture /03/2006.
Introduction to Indexes. Indexes An index on an attribute A of a relation is a data structure that makes it efficient to find those tuples that have a.
DVD DATABASE By: Sienna Bast Matthew Goodacre. PROBLEM DESCRIPTION  You want to watch a movie, but you think Tom Hanks is the best main character ever.
Relational Algebra (Chapter 7)
CS 1308 Computer Literacy and the Internet
THE DATABASE LANGUAGE SQL
Index Tuning Conventional index Secondary index To speed up queries on attributes not within primary key Primary index –Determine.
Referential Integrity checks, Triggers and Assertions Examples from Chapter 7 of Database Systems: the Complete Book Garcia-Molina, Ullman, & Widom.
Advanced SQL Concepts - Checking of Constraints CIS 4301 Lecture Notes Lecture /6/2006.
© D. Wong Normalization  Purpose: process to eliminate redundancy in relations due to functional or multi-valued dependencies.  Decompose relation.
A comparison of two quantities by division. You can write a ratio three different ways.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 10 A First Course in Database Systems.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 11 A First Course in Database Systems.
SQL Exercises – Part I April
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 18 A First Course in Database Systems.
Secondary Indexes Secondary Indexes By Jignesh Borisa(111) By Jignesh Borisa(111)
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 20 A First Course in Database Systems.
Databases : SQL Multi-Relations 2007, Fall Pusan National University Ki-Joune Li These slides are made from the materials that Prof. Jeffrey D. Ullman.
Subqueries CIS 4301 Lecture Notes Lecture /23/2006.
Structured Query Language used for defining and manipulating data in Relational DBs aimed at: –reducing training costs –increasing productivity –improve.
Presentation Title.
Presentation Title.
Logical DB Design: ER to Relational
Red Black Trees Lecture 6.
Research Project Title
Introduction to Structured Query Language (SQL)
Chapter 12 Information Systems.
The Query Compiler Parsing and Preprocessing. Meghna Jain(205)
{Project Status} Problem Statement / Issue Definition:
دانشگاه علوم پزشکی بوشهر دانشکده بهداشت
دانشگاه علوم پزشکی بوشهر دانشکده بهداشت
SQL This presentation will cover: View in database MySQL installation
CSE Students: Please do not log in yet.
Group 1 Group 1 Group 1 Group 1 word word word word word word word word word word word word word word word word word word word word word word word.
Click on Articles and Databases in the center of the page
SQL – Constraints & Triggers
Query Compiler By:Payal Gupta Shirali Choksi Professor :Tsau Young Lin.
Presentation Title Your information.
Modified at -
[Please type your poster title in white font]
Presentation transcript:

Practical Questions Movie (Title, Year, Length, inColor, StudioName, Producer) Give the SQL Statement that produced the outcome for the following query from the above mention Relation. 1.Find all the movies that produced by Disney Studios in Modify the above query (Q1) to produce only the movie title and length 3.Modify the above query (Q2) to produce a relation with attributes Name and Duration in place of title and length. 4.Modify the above query(Q3) to produced length in hours 5.Find all movies made after 1970 that are in black and white 6.Find the titles of the movies made by MGM Studios that either were made after 1970 or were less than 90 minutes long. 7.Search for all movies with a possessive (‘s) in their titles 8.List the Disney movies of 1990 from the relation by length, shortest first and among movies of equal length alphabetically.

1. Find all the movies that produced by Disney Studios in SELECT * FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990

2. Modify the above query (Q1) to produce only the movie title and length SELECT Title, Length FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

3. Modify the above query (Q2) to produce a relation with attributes Name and Duration in place of title and length. SELECT Title AS Name, Length AS Duration FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

4. Modify the above query(Q3) to produced length in hours SELECT Title AS Name, Length/60 AS LengthInHours FROM Movie WHEREStudioName = ‘Disney’ AND Year = 1990;

5. Find all movies made after 1970 that are in black and white SELECT Title FROM Movie WHEREYear > 1970 AND NOT inColor;

6. Find the titles of the movies made by MGM Studios that either were made after 1970 or were less than 90 minutes long. SELECT Title FROM Movie WHERE(Year > 1990 OR Length <90) AND StudioName = ‘MGM’;

7. Search for all movies with a possessive (‘s) in their titles SELECT Title FROM Movie WHERETitle LIKE ‘%’’s’;

List the Disney movies of 1990 from the relation by length, shortest first and among movies of equal length alphabetically. SELECT * FROM Movie WHEREstudioName = ‘Disney’ AND Year = 1990 ORDER BY Length, title;