Free Essay

Sql Homework

In:

Submitted By on4209
Words 408
Pages 2
Question 1 select [book_code],[title],[book].[publisher_code],[publisher].[publisher_name] from[book],[publisher] where [book].[publisher_code]=[publisher].[publisher_code] order by [PUBLISHER_NAME]
;
33 rows returned
3906 The Soul of a New Machine BY Back Bay Books
8092 Godel, Escher, Bach BA Basic Books
3350 Group: Six People in Search of a Life BP Berkley Publishing
669X A Guide to SQL CT Course Technology
2908 Electric Light FS Farrar Straus and Giroux
0189 Magic Terror FA Fawcett Books
9931 To Kill a Mockingbird HC HarperCollins Publishers
9882 Slay Ride JP Jove Publications
8720 When Rabbit Howls JP Jove Publications
0808 The Edge JP Jove Publications
3743 Nine Stories LB Lb Books
6908 Franny and Zooey LB Lb Books
9883 The Catcher in the Rye LB Lb Books
9701 The Grapes of Wrath PE Penguin USA
7405 East of Eden PE Penguin USA
2766 Of Mice and Men PE Penguin USA
5163 Travels with Charley PE Penguin USA
6128 Jazz PL Plume
138X Beloved PL Plume
9627 Song of Solomon PL Plume
079X Second Wind PU Putnam Publishing Group
9611 Black House RH Random House
7443 Harry Potter and the Goblet of Fire ST Scholastic Trade
2226 Harry Potter and the Prisoner of Azkaban ST Scholastic Trade
1351 Dreamcatcher: A Novel SC Scribner
5790 Catch-22 SC Scribner
0378 Venice SS Simon and Schuster
1382 Treasure Chests TA Taunton Press
0180 A Deepness in the Sky TB Tor Books
6328 Band of Brothers TO Touchstone Books
0200 The Stranger VB Vintage Books
7559 The Fall VB Vintage Books
2281 Van Gogh and Gauguin WP Westview Press
Question 2 select [book].[book_code],[title],[price] from [BOOK],[PUBLISHER] where [PUBLISHER].[PUBLISHER_CODE]=[BOOK].[PUBLISHER_CODE] And [PUBLISHER_NAME]='Scribner';
2 rows returned
1351 Dreamcatcher: A Novel 19.60
5790 Catch-22 12.00

Question 3 select [title],[book].[book_code],[price] from [BOOK],[PUBLISHER] where [PUBLISHER].[PUBLISHER_CODE]=[BOOK].[PUBLISHER_CODE] And [PUBLISHER_NAME]='Scribner' And [PRICE]>='14';
1 row returned
Dreamcatcher: A Novel 1351 19.60

Question 4 select [book].[book_code],[title],[on_hand] from [BOOK],[INVENTORY] where [BOOK].[BOOK_CODE]=[INVENTORY].BOOK_CODE
And [BRANCH_NUM]='3'
;
12 rows returned
0378 Venice 2
079X Second Wind 2
1351 Dreamcatcher: A Novel 2
2226 Harry Potter and the Prisoner of Azkaban 2
2766 Of Mice and Men 2
3906 The Soul of a New Machine 2
6128 Jazz 3
7405 East of Eden 2
8092 Godel, Escher, Bach 1
9627 Song of Solomon 5
9701 The Grapes of Wrath 3
9882 Slay Ride 3

Similar Documents

Premium Essay

Database

...principles to fully utilize the organizational role of information technology. This course provides core skills of data management for the relational database management systems. This course will review the theoretical concepts and applications of a modern relational database management system. In addition to a basic theoretical presentation of the database design concepts, students will be required to design and develop a database application using a modern fourth generation language system. This course teaches students data modeling and design techniques and how to transform data models into database designs. Another basic component of this course is the use of SQL – Structured Query Language. Students will also learn how to create databases, modify databases, and develop queries using SQL. In addition, this course also teaches the management of database resources in an organization. Course Learning...

Words: 1374 - Pages: 6

Premium Essay

Papaer

...Fall 2013 - Homework 5 In SPUFI, for the Input dataset, specify a member in DB2.SQL with the naming convention HW5Qn, where n is the question number. Example, for question 1 it would be DB2.SQL(HW5Q1). Save the output for each question in a separate output file labeled by the question number. For example: OUTPUT.SQL .HW5Q1 File transfer each file to your PC and print the output files to turn in or cut and paste to a document if the text is all shown. You must include both the SQL and the output. LABEL the output by hand for each question. Remember, you must let SQL do the work, (don’t figure it out and hard code). Below is the ERD for this assignment: 1) Create the following tablespace with the naming conventions as specified: Tablespace RnnnTSSU in your database (RnnnDB) (the STUDENT table will go in here) using stogroup UNTDISK. (3 pts.) 2) Create the STUDENT table with the specifications from the ERD (Remember, bolded attributes are not null). DOB should have a datatype of DATE (not DATETIME.) (3 pts.) 3) Create an index on the primary key of STUDENT using the UNTDISK storage group (2 pts.) 4) Perform catalog queries to ensure your tablespace, table, and index were created (1 ½ pts.) 5) Insert the following data into the STUDENT table: ( 3 pts.) S_ID S_LAST S_FIRST S_MI S_ADDRESS S_CITY S_STATE S_ZIP S_CLASS S_DOB S_PIN --------------------------------------------------------------------------------------------------------------------------JO100 JONES TAMMY R 1817...

Words: 359 - Pages: 2

Premium Essay

Student

...Spring 14 Spring 14 Homework #1 Polytechnic University of Puerto Rico Department of Computer Science, Electrical and Computer Engineering CECS 4202 Secc. 09 Prof. Alfredo Cruz Triana March 12, 2014 Polytechnic University of Puerto Rico Department of Computer Science, Electrical and Computer Engineering CECS 4202 Secc. 09 Prof. Alfredo Cruz Triana March 12, 2014 * What are the two major components of SQL and what functions do they serve? To answer this question we first have to understand what is SQL and how is it important for computer programming. Based on the information I found researching on this subject, SQL is nothing more than a database programming language designed for managing data held in a relational database management system also know as RDBMS. SQL also became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987. One of the major components of SQL is the data definition language or DDL, which manages table and index structure. This component is simply used for defining the database structure. DDL are the create, alter, rename, drop, and truncate statements which will be better explained in another question of this assignment. The other major component is data manipulation language or DML, which is used for retrieving and updating data. Said component is the subset of SQL also used to add and delete data with the use of insert, update...

Words: 675 - Pages: 3

Premium Essay

Unit 6 Assignment 1 Questions

...Unit 6 Assignment 1: Homework Learning Objectives and Outcomes Name the main events in the development of SQL statements. Run SELECT queries with wild cards, DISTINCT key word, calculations, sorting and aliasing. Run queries with the WHERE clause to filter the result sets. Use the Aggregate functions COUNT, AVG, SUM, MIN, and MAX. Assignment Requirements Answer the true-or-false questions on the next page by filling out the answer sheet. Required Resources Textbook Submission Requirements Submit your completed answer sheet to your instructor at the beginning of Unit 7. Unit 6 True/False Questions Indicate whether the following statements are true or false on the student answer sheet. 1) SQL is the programming language used to manipulate data and data objects in a relational database management system. 2) SQL is a procedural language. 3) A declarative language is a language in which you tell the computer what to do not how. 4) DML, or Data Manipulation Language, contains all the commands for selecting and modifying data. 5) DDL, or Data Definition Language, contains all the commands for selecting and modifying data. 6) The * in SELECT * clause of an SQL statement is a wildcard for returning all columns in a table. 7) The DISTINCT keyword in a SELECT statement returns only unique rows. 8) The FROM keyword is used in a SELECT clause to determine which columns are included in the query. 9) An alias in SQL is a substitute name...

Words: 363 - Pages: 2

Premium Essay

Mysql Code

...Week 2 Homework The following practice may need to be completed using the databases hosted on wmc3317-2 using WB. Use WB whether you are running queries or creating a relational schema (a data model, essentially). 1. Database: ‘bigpvfc’. Copy/paste your SQL queries below after testing that they work. a) List each customer name, address and the number of orders each has placed. (use tables: customer_t, order_t) SELECT customeraddress, customername, COUNT(*) AS number_of_orders FROM customer_t, order_t WHERE customer_t.customerid = order_t.customerid GROUP BY customername ORDER BY customer_t.customerid; b) List only name and address of customers who have placed more than two orders. SELECT customeraddress, customername, COUNT(*) AS number_of_orders FROM customer_t, Order_t WHERE customer_t.customerid = order_t.customerid GROUP BY customername HAVING number_of_orders > 2; c) List the running total of the number of total number of orders placed till date as they come in (use table: order_t). Select orderid, orderdate, (select count(*) from order_t p where co.orderd ate >= p.orderdate) as runtotal FRom order_t co Order by runtotal; 2. Database: ‘sakila’. Copy/paste your SQL queries below after testing that they work. While an employee at Sakila, you have been asked to merge the data in the ‘film’ table with an additional list of movies from http://www.hometheaterinfo.com/dvdlist.htm (dvd_csv.zip) because Sakila is expecting a large...

Words: 341 - Pages: 2

Premium Essay

Syllabus

...also available as a concatenated page, suitable for printing or saving as a PDF for offline viewing. MET CS669 Database Design and Implementation for Business This course uses the latest database tools and techniques for persistent data and object-modeling and management. Students gain extensive hands-on experience with exercises and a term project using Oracle, SQL Server, and other leading database management systems. Students learn to model persistent data using the standard Entity-Relationship model (ERM) and how to diagram those models using EntityRelationship Diagrams (ERDs), Extended Entity-Relationship Diagrams (EERDs), and UML diagrams. Students learn the standards-based Structured Query Language (SQL) and the extensions to the SQL standards implemented in Oracle and SQL Server. Students learn the basics of database programming, and write simple stored procedures and triggers. The Role of this Course in the MSCIS Online Curriculum This is a core course in the MSCIS online curriculum. It provides students with an understanding and experience with database technology, database design, SQL, and the roles of databases in enterprises. This course is a prerequisite for the three additional database courses in the MSCIS online curriculum, which are CS674 Database Security, CS699 Data Mining and Business Intelligence and CS779 Advanced Database Management. By taking these three courses you can obtain the Concentration in Database Management and Business Intelligence...

Words: 10777 - Pages: 44

Premium Essay

Bus 112 Sql Lab 2 Solution

...SQL Lab 2 Please Note: This lab requires that you understand how to write queries that were given in Lab 1 and also did hands-on work writing and running those queries. If not, you should please do Lab 1 (posted in Canvas with solutions) before working on Lab 2. Your next homework is based on these two labs. Chapters 7 and 8 in the Coronel/Rob textbook use the database for a hardware store called SaleCo. Please review the following SaleCo relational diagram –you’ll need to refer to it when writing SQL queries. NOTES: (1) The LINE table stores data about details of each transaction. Suppose an invoice is for three different products that the customer purchased, the LINE table associated with that invoice will contain three lines with each line number listing invoice number, line number, product code, quantity of the product purchased (under LINE_UNITS column), and price of the product (under LINE_PRICE column). (2) In the PRORDUCT table, the P_QOH column indicates quantity on hand (quantity in stock) for each product; P_MIN column lists the minimum quantity, i.e., when quantity on hand gets down to this level, the product needs to be re-ordered; the P_DISCOUNT column lists price discount for the product - for example .07 would indicate a 7% discount. QUERY #1: Display vendor code and name for vendors from the following two States: Florida (FL) and Tennessee (TN). Sort the output in ascending order of vendor name. A sample (partial) query output looks like the following...

Words: 484 - Pages: 2

Premium Essay

Data Design

...Homework Assignment #4 Problems #65 - #94 from page 311. Please provide your answer after each problem and submit the file with your answers through Blackboard. EliteVideo is a startup company providing concierge DVD kiosk service in upscale neighborhoods. EliteVideo can own several copies (VIDEO) of each movie (MOVIE). For example, the store may have 10 copies of the movie “Twist in the Wind”. “Twist in the Wind” would be one MOVIE and each copy would be a VIDEO. A rental transaction (RENTAL) involves one or more videos being rented to a member (MEMBERSHIP). A video can be rented many times over its lifetime, therefore, there is a M:N relationship between RENTAL and VIDEO. DETAILRENTAL is the bridge table to resolve this relationship. The complete ERD is provided in Figure P7.65. Figure P7.65 EliteVideo ERD [pic] 65. Write the SQL code to create the table structures for the entities shown in Figure P7.65. The structures should contain the attributes specified in the ERD. Use data types that would be appropriate for the data that will need to be stored in each attribute. Enforce primary key and foreign key constraints as indicated by the ERD. CREATE TABLE PRICE ( PRICE_CODE INTEGER NOT NULL UNIQUE, PRICE_DESCRIPTION CHAR(15) NOT NULL, PRICE_RENTFEE VARCHAR(3) NOT NULL, PRICE_DAILYLATEFEE VARCHAR(3) NOT NULL, PRIMARY KEY (PRICE_CODE)); CREATE TABLE MOVIE ( ...

Words: 2762 - Pages: 12

Premium Essay

Windows Operating System

...process of designing and developing databases that they can apply in their future employment. They need to create tables, enter data, and run SQL queries. This book is designed for them. Hands on Database: an Introduction to Database Design and Development focuses on the process of creating a database. It guides the student through the initial conception of the database. It covers gathering of requirements and business rules, the logical and physical design and the testing of the database. It does this through a continuous narrative that follows a student, Sharon, as she designs and constructs a database to track the tutoring program at her school. It shows some of her missteps as well as her successes. Students get hands-on experience by doing practices and developing scenarios that parallel the narrative. After completing this book students will have a good sense of what is involved in developing and creating a database. Below is a list of the book outcomes. A student who has completed this book will be able     to give a general definition of a relational database to identify a variety of ways to gather database requirements to define business rules for a database to create an Entity design for a database 2 Hands ON Database      to normalize a design up to third normal form to develop a database in a given DBMS to run SQL Queries against sample data to test requirements and business rules to define the general security context of a database and its users to document...

Words: 66591 - Pages: 267

Premium Essay

World Music

...Medgar Evers College Kamielle Ellis Man 421 04/1/15 Chapter 5 review Questions Homework Read Chapter 5 Foundations of Business Intelligence: database and Information management Page 156 to 183 Due date: April 3rd 2015 Review Key Terms Page 185 Required Text Book: Laudon, Kenneth and Laudon, Jane Management Information Systems: Managing the Digital Firm, Ninth Edition, Prentice- Hall Do Review Questions 1, 2, and 5. 1. How does a relational database organize data and how goes it differ from an object-oriented database? * Define and explain the significance of entities: attributes, and key fields. * Define a relation database and explain how it organizes and stores information. * Explain the role of entity-relationship diagrams and normalization in the database design. * Define an Object-oriented database and explain how it differs from a relational database A relational database organizes data into two-dimensional tables also called relations with columns and rows. Each table contains data on an entity and its attributes. Each row represents a record and each column represents an attribute or field. Each table also contains a key field to uniquely identify each record for retrieval or manipulation. An object-oriented database management system (DBMS) stores data and procedures that act on the data as objects, and it can handle multimedia as well as characters and numbers. Entities are the person, place, or thing...

Words: 1136 - Pages: 5

Premium Essay

B2B Advantages and Disadvantages

...This page intentionally left blank Te n t h E d i t i o n MODERN DATABASE MANAGEMENT Editorial Director: Sally Yagan Editor in Chief: Eric Svendsen Executive Editor: Bob Horan Editorial Project Manager: Kelly Loftus Editorial Assistant: Jason Calcano Director of Marketing: Patrice Lumumba Jones Marketing Manager: Anne Fahlgren Marketing Assistant: Melinda Jensen Senior Managing Editor: Judy Leale Project Manager: Becca Richter Senior Operations Supervisor: Arnold Vila Operations Specialist: Ilene Kahn Senior Art Director: Jayne Conte Cover Designer: Suzanne Behnke Cover Art: Fotolia © vuifah Manager, Visual Research: Karen Sanatar Permissions Project Manager: Shannon Barbe Media Project Manager, Editorial: Denise Vaughn Media Project Manager, Production: Lisa Rinaldi Supplements Editor: Kelly Loftus Full-Service Project Management: PreMediaGlobal Composition: PreMediaGlobal Printer/Binder: Edwards Brothers Cover Printer: Lehigh-Phoenix Color/Hagerstown Text Font: Palatino Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on appropriate page within text. Microsoft® and Windows® are registered trademarks of the Microsoft Corporation in the U.S.A. and other countries. Screen shots and icons reprinted with permission from the Microsoft Corporation. This book is not sponsored or endorsed by or affiliated with the Microsoft Corporation. Copyright © 2011, 2009, 2007, 2005, 2002...

Words: 193467 - Pages: 774

Premium Essay

Kkswmddkmdkemwekdemkedmkdemkmdkmdkew

...MODERN DATABASE MANAGEMENT / JfFFREY A. HOFFER . Warehousing Success 426 Data Warehouse Architectures 428 Generic Two-Level Architecture 428 Independent Data Mart Data Warehousing Environment 426 429 C O NTENTS Dependent Data Mart and Operational Data Store Architecture: A Three-Level Approach Logical Data Mart and Real-Time Data Warehouse Architecture 432 Three-Layer Data Architecture 435 Role of the Enterprise Data Model 435 Role of Metadata 436 Some Characteristics of Data Warehouse Data Status Versus Event Data 437 Transient Versus Periodic Data 438 An Example of Transient and Periodic Data 438 Transient Data 438 Periodic Data 439 Other Data VVarehouse Changes 440 The Reconciled Data Layer 441 Characteristics of Data after ETL 441 The ETL Process 442 Extract 442 Cleanse 444 Load and Index 446 Data Transformation 447 Data Transformation Functions 448 Record-Level Functions 448 Field-Level Functions 449 More Complex Transformations 451 Tools to Support Data Reconciliation 451 Data Quality Tools 451 Data Conversion Tools 452 Data Cleansing Tools 452 Selecting Tools 452 The Derived Data Layer 452 Characteristics of Derived Data 452 The Star Schema 453 Fact Tables and Dimension Tables 453 Example Star Schema 454 Surrogate Key 455 Grain of Fact Table 456 Duration of the Database 456 Size of the Fact Table 457 Modeling Date and Time 458 Variations of the Star Schema 458 Multiple Fact Tables 458 Factless Fact Tables...

Words: 80097 - Pages: 321

Premium Essay

English Literature

...INTRODUCTION There is little doubt that no two people study the same way, and it is a near certainty that what works for one person may not work for another. However, there are some general techniques that seem to produce good results. So I decided to concentrate on working for this research because it’s very important for the readers to read this so that they have to step up in learning styles. My purpose of doing this research is to develop myself and to serve this thing as stepping stone to make a thesis and in consideration in making a book. Now I am making this just to show you how the proper process of learning is. The purpose of this research is to provide us significant ideas about real learning styles, study skills and thinking skills in analyzing some neither questions nor problems that we don’t know and to improve and enhance our memory in studying some lessons in a book. It also improves us to organize our studies, express our ideas clearly and effectively and how to communicate with others clearly and fluently. The first part of this research is focused on defining the three bodies of skills and you will know the utilization of effective language-learning strategy is. These three bodies of skills approaches us to have more experience on how to learn to be critical to success in school, considered essential for acquiring new good grades and useful for learning through out’s life. Of course this convinces us that these skills can be applied in other areas...

Words: 1625 - Pages: 7

Premium Essay

Blaaaaaaah

...internationalstudiesdefinitionkan... - Isalin ang pahinang ito 1 Dec 2011 – A HABIT is something that is done on a scheduled, regular and planned basis that is not relegated to a seccond place or optional place in one's ... Meaning of study habits wiki.answers.com › ... › Learning Theories - Isalin ang pahinang ito Relevant answers: What is the meaning of good study habits? good study habits is simply studying good. What is study habits? == Answer ==. The manner with ... What is the Definition of study habit wiki.answers.com/.../What_is_the_Definition_... - Isalin ang pahinang ito It means you are not distracted by anything, you have a certain place to go where it is quiet everyday where you study and do homework. Basically it means that ... What are study habits wiki.answers.com › ... › Education › Learning Tips - Isalin ang pahinang ito Study habits are the ways that you study - the habits that you have formed during ... It means you are not distracted by anything, you have a certain place to go ... Study Habits - Term Paper - Rojilei www.termpaperwarehouse.com/.../Study-Habi... - Isalin ang pahinang ito 9 Jan 2012 – Before we proceed, let's define the meaning of study and habit. Study is to buy out the time and dedicate self to application and the task of study ... Study skills - Wikipedia, the free encyclopedia...

Words: 389 - Pages: 2

Premium Essay

Abseenteism

...Using Student Self-Reflections to Improve Student Study Habits in the Mathematics Classroom A Capstone Project Submitted in Partial Fulfillment of the Requirements for the Degree of Master of Arts in Teaching: Mathematics Nancy Daly Department of Mathematics and Computer Science College of Arts and Sciences Graduate School Minot State University Minot, North Dakota Summer 2011 ii This capstone project was submitted by Nancy Daly Graduate Committee: Dr. Laurie Geller, Chairperson Dr. Cheryl Nilsen Dr. Rebecca Anhorn Dean of Graduate School Dr. Linda Cresap Date of defense: Month day, year iii Abstract Type the abstract here. Do not indent. It should be one block paragraph. The abstract is a summary of your paper. iv Acknowledgements Type your acknowledgements here. Indent each paragraph 0.5 inch. You can thank whomever you choose. v Table of Contents Page Abstract .................................................................................................................. iii Acknowledgements ................................................................................................ iv List of Tables ....................................................................................................... viii List of Figures ........................................................................................................ ix Chapter One: Introduction ................................................................

Words: 7903 - Pages: 32