Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Database course:
a. Write in SQL a command that creates the table Customers according to the above description.
b. Write in SQL a statement that adds a new column named accountID of type Char(8). This column should be defined as a foreign key that relates the table Customers to the table Account.
c. Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990.
d. Write a SQL query that displays the number of customers who born on the 16th day of a month.
e. Write in SQL a query that displays the ids of the customers who have the highest income.
f. Create a view named ‘customerDetails’ to hold all the details of customers whose first names start with ‘S’ and their incomes are between 500 and 1000 Omani Rials.
(I need the codes to copy them please)
Photo is there.
q4)
Which of the following is the correct definition of alias in SQL statement?
a.
It is a way of renaming a column heading in the output
b.
It specifies the table containing the columns listed in the SELECT clause
c.
It is a value that is unavailable, unassigned, unknown, or inapplicable
d.
It retrieves information from the database
Which of the following is a correct statement?a. A commit is issued implicitly when a user exits SQL Developer or SQL*Plus.b. A commit is issued implicitly when a DDL command is executed.c. A commit is issued automatically when a DML command is executed.d. All of the above are correct.e. Both a and b are correct.f. Both a and c are correct
Chapter 5 Solutions
Oracle 12c: SQL
Ch. 5 - Which command should you use to copy data from one...Ch. 5 - Which command can you use to change the existing...Ch. 5 - Which of the following is a correct statement? a....Ch. 5 - Which of the following is a valid SQL...Ch. 5 - Which of the following statements deletes all rows...Ch. 5 - What is the maximum number of records that can be...Ch. 5 - Add a new row in the ORDERS table with the...Ch. 5 - Prob. 2HOACh. 5 - Save the changes permanently to the database.
Ch. 5 - Add a new row in the ORDERS table with the...
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
- I(1) - MidOsoft Word عرض مراسلات أبجد هوز أيجد هوز أبجد هوز أيجد هوز أبجد هوز 而市,,三. ◆ 5 úlgic 4 úlgic 2 ülgic 1 ülgic Sole 1 A. blast 3.Write a program in PL/SQL to display sum of odd numbers from 1 to n. Cood TOSHIBAarrow_forwardWrite SQL queries for the following statements. 1) Write SQL code which declares two variables for name and address. Store your name and address in respective variables. Display name and address in a single line using print statement. 2) Display table of 10 in given format using 10 x 1 = 10 10 x 2 = 20 . . . 10 x 10 = 100. 3) Write a code which declares a variable and stores age of youngest employee from “Employee” table. And display name of youngest employee 5 times his. 4) Assume that in “Employee” table, Emp_id are assigned from 1 to onward. ie first employee’s eid is 1, second employee’s eid is 2 and so on. Write a code that displays name of eldest employee without using aggregate function of “max”. You can use count functionarrow_forwardThe SQL SELECT statement performs case-sensitive comparisons. a. True b. Falsearrow_forward
- Write in SQL a command that creates the table Supplier according to the above description . Write in SQL a statement that adds a new column named comapnyID of type char(5). This column should be defined as a foreign key that relates the table Supplier to the table Company . Write in SQL a query that lists the full names (first and last names) of all suppliers arranged in ascending order according to their date of births . Write a SQL query that displays the number of suppliers who born in December . Write in SQL a query that displays the ids of the suppliers who supply the highest number of products . Create a view named ‘SupplierDetails’ to hold all the details of suppliers whose last names start with ‘bait’ and who supply between 50 and 200 products .arrow_forward9. You want to track date and time of the last write access per row in SQL server?a) Add TIMESTAMP column to the tableb) Add a DATETIME column to the table and assign getdate() as the default valuec) Add a DATETIME column to the table and write a trigger that sets its valued) Add a UNIQUEIDENTIFIER column to the table and use it with SQL Server’s built-in functionsarrow_forwardThis is a database system question regarding SELECT: Which of the following statements is true for SELECT statements in general? a. HAVING is executed before WHERE when running an SQL query b. SELECT is executed before FROM when running an SQL query c. Each SELECT clause must have a WHERE clause as well. d. COUNT(column_name) function returns the number of values in the column, including any NULLs e. HAVING clause specifies a condition for selecting grouped tuples from the GROUP BY clause.arrow_forward
- SQL procedure a. Write a procedure in SQL that inserts a new customer record into the "Customers" table. b. Create a procedure that updates the quantity of a product in the "Inventory" table based on the product ID. c. Write a procedure that calculates the average salary of all employees in the "Employees" table and displays the result.arrow_forwardINFO 2303 Database Programming Assignment # : PL/SQL Procedure & Function Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. Write a script to create a PL/SQL procedure called findSal that displays the doctor’s salary and bonus after passing in the doc_id into the procedure. For example, if you pass in doc_id 504, you will get the following output. execute findSal(504) The salary for Dr.Cotner (504) is: 11500 The bonus is: 7500 PL/SQL procedure successfully completed.arrow_forwardWhere shouId I put the while loop in these programs thanks? Develop a two small PL/SQL programs. 1. Enter instructor ID from the keyboard. The program then finds instrutor's first name, last name and phone, stores them in variables and prints them on the screen. USE WHILE LOOP to print all instructors while selecting them one by one in the loop. 2. Similar to the above, only this time the program will receive student's first name only (instead of ID)Then program finds full name and address and prints it on the screen (work with STUDENT table here) For both programs please implement NO_DATA_FOUND and TOO_MANY_ROWS exceptions. (please refer to chapter 8 in PL/SQL by Example book)For number 2 program, display a message "Possibly you have two or more students with the first name ...." in TOO_MANY_ROWS exception block. 1* select table_name from user_tablesSQL> desc studentName Null? Type----------------------------------------- -------- ----------------------------STUDENT_ID NOT NULL…arrow_forward
- Online shopping system & online book store: Rebuild View/Edit cart and checkout pages using PL/SQL like the following: Create a function/procedure to update the quantity of the product in the cart if the new quantity is available in the store. Create a trigger that deletes the product from the cart after updating the quantity to 0. Don't forget to return the old quantity to the store. Create a trigger that empties the customer cart after the customer clicks on the checkout.arrow_forwardAssume that you have a product code that has the following format: XXXXNNN Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero). Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be: Product Name is: ABC Serial Number is: 031arrow_forwardAssume that you have a product code that has the following format: XXXXNNN Where X is a character and N is a digit. Notice that the length of the character part is not fixed, it may range from 2 to 4 characters, while the length of the second part may range from 2 to 3 digits but the first digit from the left is always 0 (zero). Write a PL/SQL program to separate the code into its two parts as shown in the following example: if the input is ABC031, the output should be: Product Name is: ABC Serial Number is: 031 Hints: Use the following functions if needed: instr( string1, string2 [, start_position [, nth_appearance ] ] ) substr( string, start_position, [ length ] ) length( string ) DBMS_OUTPUT.PUT_LINE( )arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY