Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Using AdventureWorks
SQL
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a query in SQL to display all the data of customers, in Table customers, that live in New York or California SELECT city FROM customers WHERE city = 'New York' OR city = 'California' SELECT * FROM customers WHERE city = 'New York' AND city = 'California' SELECT * FROM customers WHERE city = 'New York' OR city = 'California' SELECT ALL FROM customers WHERE city = 'New York' OR city = 'California' %3Darrow_forwardIn SQL code: Create a PL/SQL block to retrieve the name of each employee from the EMPLOYEE table and print the first initial of each name on the screen, incorporating an INDEX BY table.arrow_forwardPlease help with the following: Using oracle sql live or sql developer what sql statements could be use to find the following: A simple database composed of the following tables: PATIENT, DOCTOR, DRUG, and PRESCRIPTION. Please explore the database and then write the appropriate SQL command. List doctor’s details where speciality is either Dermatology or Neurology. (Use INoperator). List the results by the first name in ascending order and the last name indescending order. Find all patients rows whose first names include ‘George’ (Assume case sensitivity). sql doc below Beginfor c in (select table_name from user_tables) loopexecute immediate ('drop table '||c.table_name||' cascade constraints');end loop;End;//* */ ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';CREATE TABLE DOCTOR (DOC_ID varchar2(5) PRIMARY KEY,DOC_LNAME varchar2(15),DOC_FNAME varchar2(15),DOC_INITIAL varchar2(1),DOC_SPECIALTY varchar2(15));INSERT INTO DOCTOR…arrow_forward
- Please written by computer sourcearrow_forwardWrite a SQL query to find the customer# of those customers that purchased at least once in July 2020 but NOT in August 2020. In addition to the customer#, show the ISBN and title of the book(s) they purchased in July 2020. You may use only one query. No creating any temporary tables or subqueries. You may use only joins. SUBMIT a second solution in addition to your Level 1.arrow_forwardThe given SQL creates a Song table and inserts some songs. The first SELECT statement selects songs released after 1992. The second SELECT statement selects the release year for song with ID 800. Create a third query that combines the two existing queries. The first SELECT should be the outer query, and the second SELECT should be the subquery. The ORDER BY clause should appear after the subquery. Run your solution and verify the new query returns a result table with five rows, all with release years after 1992. CREATE TABLE Song (ID INT,Title VARCHAR(60),Artist VARCHAR(60),ReleaseYear INT,Genre VARCHAR(20),PRIMARY KEY (ID)); INSERT INTO Song VALUES(100, 'Hey Jude', 'Beatles', 1968, 'pop rock'),(200, 'You Belong With Me', 'Taylor Swift', 2008, 'country pop'),(300, 'You\'re Still the One', 'Shania Twain', 1998, 'country pop'),(400, 'Need You Now', 'Lady Antebellum', 2011, 'country pop'),(500, 'You\'ve Lost That Lovin\' Feeling', 'The Righteous Brothers', 1964, 'R&B'),(600, 'That\'s…arrow_forward
- Task 3: The InstantRide Finance team wants to collect the price and discount information with the driver names for each travel in the system. You need to return the TRAVEL_ID, DRIVER_FIRST_NAME, DRIVER_LAST_NAME, TRAVEL_PRICE, and TRAVEL_DISCOUNT information from the TRAVELS and DRIVERS tables combined over DRIVER_ID field with the ON keyword. Task: Calculate each user's price and discount information. (SQL Database Test)arrow_forwardSQL Code for Extend the code in (Perform a LEFT OUTER JOIN between the tables Wicketkeeping and Batting. You may select any column(s). Look at the result and state how many wicketkeepers have not played as batsmen (no need to write code for this part ) To show the name of the fielders who have played 7 times as many matches as the wicketkeeper(s) in 5).arrow_forwardGo to the w3schools website’s SQL browser IDE. This is where you canwrite and test your SQL code using their databases. Once you are happywith it, paste your code in a text file named Student.txt and save it in yourtask folder.● Write the SQL code to create a table called Student. The table structure issummarised in the table below (Note that STU_NUM is the primary key):Attribute Name Data TypeSTU_NUM CHAR(6)STU_SNAME VARCHAR(15)STU_FNAME VARCHAR(15)STU_INITIAL CHAR(1)STU_STARTDATE DATECOURSE_CODE CHAR(3)PROJ_NUM INT(2)● After you have created the table in question 1, write the SQL code to enterthe first two rows of the table as below:STU_NUMSTU_SNAMESTU_FNAMESTU_INITIALSTU_STARTDATECOURSE_CODEPROJ_NUM01 Snow John E 05-Apr-14 201 602 Stark Arya C 12-Jul-17 305 11● Assuming all the data in the Student table has been entered as shownbelow, write the SQL code that will list all attributes for a COURSE_CODE of305.…arrow_forward
- HW2: Basic SQL 1. Write a query that will show all probation officers 2. Write a query that will show the first and last names of probation officers 3. Now write a query that shows first and last name of probation officers. Include the field prob_id but rename prob_id to probation officer ID. 4. Write a query that will show crime id, and the total charges for each crime ID. Include an alias for the total charges column called Total Charges. 5. Write a query that will concat the last and first names of criminals into one column. Add a space and comma between the last and first name of criminals. Give the column the alias Criminal Name. 6. List the last name and first name of all authors in only 1 column. Add a comma to separate the two names. 7. Run a query that will return the order#, item#, isbn, quantity, paideach. Include in the query a arithmetic operation that will total quantity and paideach. Alias the virtual column so it is labeled Item Totalarrow_forwardCreate a Pl SQL package named EMP_PKG which will have the above three functions and procedures as follows: CALC_TAX - private CHECK_FNAME - Public AVG_SAL - Publicarrow_forwardYou have a table named student having attributes student_name, id, batch, contact. Write a SQL query to display the names of all students in alphabetically increasing order.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education