A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 7, Problem 7CAT
Program Plan Intro
Index deletion:
The “DROP INDEX” command is used to delete the index from the data base.
Syntax for deleting index is as follows:
DROP INDEX INDEX_NAME;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
CREATE TABLE test( test_id INTEGER PRIMARY KEY, test_name varchar2 (255) ,t_date DATE, t_result varchar2(255));ALTER TABLE test ADD (t_time varchar2(1));INSERT INTO test values ('5454','corona','monday','11:15PM','positive'); (6567,'corona','sunday','10:50AM','negative');
Create a new table named BOOK_TYPE in the finalexam database. The BOOK_TYPE table has two character columns: TYPE has a length of 3 characters and is the table’s primary key, and DESCRIPTION has a length of 20 characters.
SQL
CREATE TABLE `zoo`.`Habitats`( `id` INT(50) NOT NULL AUTO_INCREMENT, `habitatName` VARCHAR(50), `habitatLocation` VARCHAR(50), PRIMARY KEY (`id`) );
CREATE TABLE `zoo`.`Animal`( `animalId` INT(50) NOT NULL AUTO_INCREMENT, `animalName` VARCHAR(50), `animalBirthdate` DATE, `species` VARCHAR(50), `habiat` INT(50), PRIMARY KEY (`animalId`), FOREIGN KEY (`habiat`) REFERENCES `zoo`.`habitats`(`id`) );
Add appropriate indexes. This database requires at least 2 indexes in addition to those automatically created by MySQL.
Chapter 7 Solutions
A Guide to SQL
Ch. 7 - What is a view?Ch. 7 - Which command creates a view?Ch. 7 - Prob. 3RQCh. 7 - What happens when a user retrieves data from a...Ch. 7 - What are three advantages of using views?Ch. 7 - Which command deletes a view?Ch. 7 - Prob. 8RQCh. 7 - Which command terminates previously granted...Ch. 7 - Prob. 10RQCh. 7 - How do you create an index? How do you create a...
Ch. 7 - Prob. 12RQCh. 7 - Does the DBMS or the user make the choice of which...Ch. 7 - Describe the information the DBMS maintains in the...Ch. 7 - The CUSTOMER table contains a foreign key,...Ch. 7 - Prob. 16RQCh. 7 - Prob. 17RQCh. 7 - Prob. 18RQCh. 7 - Prob. 19RQCh. 7 - When would you usually specify primary key...Ch. 7 - Prob. 21RQCh. 7 - Prob. 22RQCh. 7 - Prob. 23RQCh. 7 - Use SQL to make the following changes to the TAL...Ch. 7 - Create a view named ITEM_ORDER. It consists of the...Ch. 7 - Create a view named ORDER_TOTAL. It consists of...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Prob. 5TDCh. 7 - Perform the following tasks: a. Create an index...Ch. 7 - Delete the index named ITEM_INDEX3.Ch. 7 - Write the commands to obtain the following...Ch. 7 - Prob. 9TDCh. 7 - Prob. 10TDCh. 7 - Toys Galore currently has a credit limit of 7,500....Ch. 7 - Use SQL to make the following changes to the...Ch. 7 - Create a view named RESERVATION_CUSTOMER. It...Ch. 7 - Create a view named TRIP_INVENTORY. It consists of...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Prob. 5CATCh. 7 - Create the following indexes: a. Create an index...Ch. 7 - Prob. 7CATCh. 7 - Write the commands to obtain the following...Ch. 7 - Prob. 9CATCh. 7 - Ensure that the only legal values for the TYPE...Ch. 7 - Prob. 11CATCh. 7 - Use SQL to make the following changes to the...Ch. 7 - Create a view named CONDO_OWNERS. It consists of...Ch. 7 - Create a view named CONDO_FEES. It consists of two...Ch. 7 - Write, but do not execute, the commands to grant...Ch. 7 - Prob. 5SCGCh. 7 - Prob. 6SCGCh. 7 - Delete the OWNER_INDEX 3 index from the OWNER...Ch. 7 - Write the commands to obtain the following...Ch. 7 - Prob. 9SCGCh. 7 - Ensure that the only legal values for the BDRMS...Ch. 7 - Prob. 11SCG
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
- Delete the OWNER_INDEX 3 index from the OWNER table.arrow_forwardHow do you create an index? How do you create a unique index? What is the difference between an index and a unique index?arrow_forwardA new table has been requested to support tracking automated emails sent to customers. Create the table and add data as described below. Tablename: email_log Columns: emailid (numeric), emaildate (datetime), customer# (numeric) Primary key: emailid column, define as an Identity Column Add the following data rows and display resulting rows (if any errors occur, explain why the error is expected) Emaildate = current date, customer# = 1007 Emailid = specify to use the column default value, emaildate = current date, customer# = 1008 Emailid = 25, emaildate = current date, customer# = 1009arrow_forward
- Add a constraint to make sure the Rep_ID value entered in the BOOK_STORES table is a valid value contained in the STORE_REPS table. The Rep_ID columns of both tables were initially created as different datatypes. Does this cause an error when adding the constraint? Make table modifications as needed so that you can add the required constraint.arrow_forwardselect * from cast where cast_id=162652763; Use explain to display the query plan without creating any index. Now create an index to speed up the query. Use explain and timer to show the improvement.arrow_forwardWhich of the following commands can you use to modify an index? MODIFY INDEX ALTER TABLE none of the above ALTER SESSION ALTER INDEXarrow_forward
- (Database) How do I rewrite this trigger code to be a row level trigger? after writing, test the code by inserting a new row. CREATE OR REPLACE TRIGGER UPDATE_ORDERS AFTER INSERT OR UPDATE OF Units, Price ON ORDERS FOR EACH ROW BEGIN UPDATE ORDERS SET new.Total = Units*Price; END; *For reference, this is the code for the orders table: CREATE TABLE ORDERS( ORDERNO INTEGER PRIMARY KEY, PRODUCT VARCHAR(20), UNITS INTEGER, PRICE NUMBER, TOTAL NUMBER);arrow_forwardCreate an ADD TRIGGER. Explain what the trigger does. Test and show the related results of this trigger. Table 1: CREATE TABLE BSR_PASSENGER (PASSENGER_ID INT NOT NULL UNIQUE, FULL_NAME VARCHAR(30), COUNTRY VARCHAR(40), CITY VARCHAR (40), PRIMARY KEY (PASSENGER_ID)); Table 2: CREATE TABLE BSR_FLIGHT (FLIGHT_ID INT NOT NULL UNIQUE, AIRLINE_NAME VARCHAR(50), CREW_MEMBERS INT, PRIMARY KEY (FLIGHT_ID)); Table 3: CREATE TABLE BSR_BOOKING (BOOKING_ID INT NOT NULL UNIQUE AUTO_INCREMENT, PASSENGER_ID INT NOT NULL, FLIGHT_ID INT NOT NULL, COST DEC(6,3), PRIMARY KEY (BOOKING_ID), FOREIGN KEY (PASSENGER_ID) REFERENCES BSR_PASSENGER(PASSENGER_ID), FOREIGN KEY (FLIGHT_ID) REFERENCES BSR_FLIGHT(FLIGHT_ID));arrow_forwardAdd two columns to the EMPLOYEES table. One column, named EmpDate, contains thedate of employment for each employee, and its default value should be the system date. Thesecond column, named EndDate, contains employees’ date of termination. When I put this formal it says, line 2 has invalid identifier! Can you help me what I need to fix from line 2? alter table EMPLOYEES2add column EmpDate date = getdate(),add column EndDate;arrow_forward
- Create a form to insert/update/delete medicine details into the database. in c# (. Pharmacy Store)arrow_forwardCreate a trigger named tInstructors_UPDATE that checks the new value for the AnnualSalary column of the Instructors table. This trigger should raise an appropriate error if the annual salary is greater than 120,000 or less than 0.arrow_forwardWhat can be referenced to determine whether an index is used to perform a query?a. USER_INDEXES viewb. query source codec. explain pland. database access planarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr