A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 5RQ
Explanation of Solution
a)
COMMISSIONRATE:
It is a valid option in Oracle...
Explanation of Solution
b)
POSTAL_CODE_5CHAR:
It is a valid option in Oracle...
Explanation of Solution
c)
SHIP TO ADDRESS:
It is an invalid option in Oracle...
Explanation of Solution
d)
INVOICE-NUMBER:
It is an invalid option in Oracle...
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Which of the following is true? (refer to the tables in the JustLee Books database)a. If you truncate a table, you can’t add new data to the table.b. If you change the default value of an existing column, all existing rows containing a NULL value in the same column are set to the new DEFAULT value.c. If you delete a column from a table, you can’t add a column to the table with the same name as the previously deleted column.d. If you add a column to an existing table, it’s always added as the last column of the table.
What Oracle function should you use to compute the number of days that have passed between your birthday and the current date?
Instructions
Write SQL queries to solve the following problems. We will be using the “university” database. All queries should involve only the instructor table. After you are done, save your work as .sql file and turn in the .sql file into Moodle for grading.
Write a SQL statement to display all columns using the SQL asterisk (*) wild-card character.
Write a SQL statement to display ID and name of the instructors (ID appears first).
Write a SQL statement to display department names.
Write a SQL statement to display unique department names. (expect 7 rows returned)
Write a SQL statement to display all info about instructors having a salary greater than 75000. (expect 6 rows returned)
Write a SQL statement to display department name, instructor name, and salary for instructors that have a salary less than 70000. Sort the results in ascending order by department name. (expect 4 rows returned)
Write a SQL statement to display name, department name, and salary for instructors that have a…
Chapter 3 Solutions
A Guide to SQL
Ch. 3 - Prob. 1RQCh. 3 - How do you delete a table using SQL?Ch. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Use SQL to complete the following exercises....Ch. 3 - Prob. 2TDCh. 3 - Prob. 3TDCh. 3 - Prob. 4TDCh. 3 - Prob. 5TDCh. 3 - Prob. 6TDCh. 3 - Prob. 7TDCh. 3 - Prob. 1CATCh. 3 - Add the following row to the ADVENTURE_TRIP table:...Ch. 3 - Prob. 3CATCh. 3 - Prob. 4CATCh. 3 - Prob. 5CATCh. 3 - Prob. 6CATCh. 3 - Review the data for the TRIP table in Figure 1-5...Ch. 3 - Colonial Adventure Tours would like to increase...Ch. 3 - Prob. 1SCGCh. 3 - Add the following record to the VACATION_UNIT...Ch. 3 - Delete the VACATION_UNIT table.Ch. 3 - Prob. 4SCGCh. 3 - Prob. 5SCGCh. 3 - Prob. 6SCGCh. 3 - The SERVICE_REQUEST table uses the CHAR data type...
Knowledge Booster
Similar questions
- ) Create a database called cars that has these tables or write the SQL command to create the database and the tables Car(car_ID, car_name, price, color, manufacturer, No_cylinder, owner_ID) Owner(owner_ID, name, No_cars, phone_No, address) answer the following SQL queries: 1- Find the cars names that has 4 cylinders and its price is greater than the average price of all cars that manufactured by Audi. 2- Find all red cars owned by Mr.Ali. 3- find the summation of black cars prices that has 4 cylinder. 4- delete all the owners who live in New York.arrow_forwardIm trying to run the following SQL in Oracle: SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeChargedFROM FEE_KRJOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceIDJOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestIDWHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee Description')WHERE ServiceName NOT IN (SELECT FEETYPE FROM REPORT_FILTER_KR)GROUP BY GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeChargedORDER BY SUM(FeeCharged) DESC; And I'm recieving this error: Error starting at line : 1 in command -SELECT GUEST_KR.FIRSTNAME, GUEST_KR.LASTNAME,FEE_KR.DateCharged,FEE_KR.FeeDescription,FEE_KR.FeeCharged,SUM(FeeCharged) AS TotalFeeChargedFROM FEE_KRJOIN SERVICE_KR ON FEE_KR.ServiceID = SERVICE_KR.ServiceIDJOIN GUEST_KR ON SERVICE_KR.ServiceID = GUEST_KR.GuestIDWHERE ServiceName IN ('First Name', 'Last Name', 'Date Charged', 'Fee…arrow_forwardIf an integer is multiplied by a NULL value, the result is: (refer to the tables in the JustLee Books database.)a. an integerb. a whole numberc. a NULL valued. None of the above—a syntax error message is returned.arrow_forward
- Execute the following statements using MYSQL: 1.Create a Trigger "trigger regno" for the salesman table (Before INSERT) set the value as O for the experience > 7 and evaluate it. Also write the syntax to drop the Trigger "trigger regno* 2. Insert a value for Customer table (#Last 3 digit of your register no, #Your name, Vellore, 55, 010). Insert a value for salesman table ("10", #Your name, 5, 4000). 3. List out the number of customers in each city by arranging them from low to high. ( 4. Select all the salesman who's work experience is between 4 and 8.arrow_forwardFill the blanks with the suitable PL/SQL statements that correct each of the errors that appear in the given PL/SQL program. declare vAddress employee.Address%VR0WTYPE; begin select ename , address into vAddress from employee where salary = 1500; DBMS_OUTPUT.PUT_LINE('NOM =' || vEname || 'Adresse=' || vAddress ); exception when MANYROWS then dbms_output.put_line("This query returned many rows"); end;arrow_forwardThe database contains a Horse table, with columns: ID integer, primary key Registered Name variable-length string. The database contains a Student table, with columns: • ID integer, primary key First Name - variable-length string LastName variable-length string Write a SQL Query to create a Schedule table, with columns: HorseID - integer with range 0 to 65535, not NULL • Student ID integer with range 0 to 65535 Lesson DateTime - date/time, not NULL (HorseID, Lesson DateTime) is the primary key Also, create the following foreign key constraints on Schedule columns: HorseID references Horse. When an ID is deleted from Horse matching Lesson Schedule rows are deleted. Student ID references Student. When an ID is deleted from Student, matching Student ID 's are set to NULL).arrow_forward
- Database Access Code Write the codethe best that you can to execute the following SQLstatement against a database. Your code should read thedata from the DB and print out all of the data. Thedatabase is an Access database, setup with an ODBCname of "AccountingDB'. Do the best you can, partialcredit will be given. Put your code in the main methodgiven below. [Hint: SQL will return all accounts from thedatabase.]SOL = "Select AcctNo, Owner, Balance fromAccounts"public static void main (String args[])arrow_forwardBelow is part of a Student database. The primary keys are highlighted in bold. Student (studNo, studName, address, mobileNo) Registration (studNo, courseNo, regDate, semester, session) Course (courseNo, courseName, creditHour, level) Project (projNo, projName, courseNo) Assignment (projectNo, studNo, startDate, dueDate, hoursSpent) QUESTION 1. Write a PL/SQL FUNCTION that calculates the cost each student has to pay for all courses taken. In the photo is example the cost detail for each course. 2. Write a PL/SQL Procedure to call the function you created in question 1 . Allow the user to enter the student ID (studno). SECOND PHOTO IS THE EXAMPLE OF EXPECTED OUTPUTarrow_forward. Which of the following is not a valid statement? (refer to the tables in the JustLee Books database) a. You can change the name of a table only if it doesn’t contain any data.b. You can change the length of a column that doesn’t contain any data.c. You can delete a column that doesn’t contain any data.d. You can add a column to a table.arrow_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