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
Create a new table called MY_BOOKS based on the BOOK table. You must use a subquery to create MY_BOOKS table. It should have the following fields: BOOK_NUM, BOOK_TITLE, BOOK_TITLE, BOOK_SUBJECT, BOOK_COST
Hint: type SQL commands either ALL in CAPITAL letters or ALL in LOWERCASE letters. (No case mixing). Also, if you misspell a command, the answer will be counted as incorrect.
TABLE MY_BOOKS
BOOK_NUM, BOOK_TITLE, BOOK_SUBJECT, BOOK_COST
BOOK;
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 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 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_forwardYou can create both Inner Join and Left Join on same Tableau File on different worksheet. Group of answer choices : True False In Techwear, the shipping number becomes the sales transaction number when the invoice is created, Group of answer choices : True Falsearrow_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_forwardChallenge 1 v= Ⓒ Challenge #1 - Part 5 Task Determine what the sale price would be for each item if the Marketing team went off the rails and implemented a sale for 35% off the original price of all items! Once again, add this new column onto the end of your existing query and name it discount_35. ► Want a hint? III = query.sql + 1 SELECT *, original_price* (1 0.35) AS discount_35 2 FROM retail.products; 42442 3 5 product_id sku CT- BLK- 8 1 SQL Viewer 2 CT- BLK- 8.5 X + Cap Toe - Cap Toe product_type color size full_name category material created_at black 8.0 black 8.5 Cap Toe - Black - 8 Cap Toe - Black - 8.5 men men leather i leather X 2016-09- 12 2016-09- 12arrow_forwardSQL Server Please help answer question 5 Please type out the answer because I cannot read the last answer because the handwriting is not very clear. Thank you.arrow_forward
- PLZ hlp with the following: In SQL If you add the PRIMARY KEY constraint to a column, you must also add a UNIQUE constraint to it. Select one: True Falsearrow_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_forward6.7 LAB - Create Vehicle and EventVehicle tables The California DMV's completed table diagram is presented in the zyBook. The following is a portion of the table di Vehicle VehicleID TypeCode R YearNumber R MakeCode R ModelName R PlateID R VehicleEvent StateCode R -restrict- • VehicleID RegistrationDate -restrict- • EventNumberarrow_forward
- Q1. Please write a query statement from emp table to display employee's empno, ename, length of ename, number of 'S',and number of 'L'. SQL> SELECT empno AS "EmpNo", ename AS "Emp Name", ... AS "Name Length", .... AS "# Of S", .... AS "# Of L"FROM emp; [IMAGE below] Material to answer the question above: Material: https://drive.google.com/file/d/14OwWDIybjAIeuHCO7McupV08gJs9nB-8/view?usp=sharing https://drive.google.com/file/d/1npRH8JoJ6GYBzPU3iNjLXluvCyhr2tMu/view?usp=sharingarrow_forwardWhich of the following statements is correct? ( refer to the tables in the JustLee Books database). a. A PRIMARY KEY constraint allows NULL values in the primary key column(s). b. You can enable a dropped constraint if you need it in the future. c. Every table must have at least one PRIMARY KEY constraint, or Oracle 12 c doesn’t allow the table to be created. d. None of the above statements is correctarrow_forwardHOW TO FIX THIS CODE IN ORACLE SQL ?CREATE OR REPLACE PROCEDURE CONVERT_VAL(V1 VARCHAR,V2 VARCHAR,AMT NUMBER) IS val VARCHAR2(100); val1 VARCHAR2(2); val2 varchar2(2); amount number; DECLARE meter NUMBER := 0; Cem NUMBER := 0; BEGIN val1:=v1; val2:=v2; amount:=amt; Select case when val1!=val2 then case when lower(val1)='km' meter := km * 1000; Cem := meter * 100; dbms_output.Put_line('The value of KM NUMBER KM to meters is: ' ||meter); dbms_output.Put_line('The value of KM NUMBER KM to centimeters is: ' ||cem); when lower(val1)='m' dbms_output.Put_line('The value of M NUMBER M to KM is: ' ||KM); dbms_output.Put_line('The value of M NUMBER M to centimeters is: ' ||cem); when lower(val1)='Cm' dbms_output.Put_line('The value of M NUMBER CM to KM is: ' ||KM); dbms_output.Put_line('The value of M NUMBER CM to M is: ' ||M); else 'same…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