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
Write 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 function
The SQL SELECT statement performs case-sensitive comparisons. a. True b. False
9. 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 functions
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
- 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_forwardYOu have to find SQL code of all and show outputarrow_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
- 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_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_forwardDevelop a two small PL/SQL programs. 1. Enter students ID from the keyboard. The program then finds student's first name, last name and phone, stores them in variables and prints them on the screen. 2. Similar to the above, only this time the program will receive student's first name only (instead of student's ID)Then program finds full name and address and prints it on the screen. 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.arrow_forward
- Assume 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_forwardWhich of the following is not a valid SQL statement? (refer to the tables in the JustLee Books database.)a. SELECT MIN(pubdate)FROM booksGROUP BY categoryHAVING pubid = 4;b. SELECT MIN(pubdate)FROM booksWHERE category = 'COOKING';c. SELECT COUNT(*)FROM ordersWHERE customer# = 1005;d. SELECT MAX(COUNT(customer#))FROM ordersGROUP BY customer#;arrow_forward
- A. If you are at the SQL prompt, use !filename to open a file called filename and execute the commands inside the file. TRUE OR FALSE B. If you use an ORDER BY clause, it must always be the last clause in the SQL Query statement. TRUE OR FALSE C. If you want to create a Cartesian product, simply do not join the tables in an SQL query statement. TRUE OR FALSEarrow_forwardFor the remaining questions, use the following table of people: people (id (pk), firstname, lastname, spouse_id (fk)) The table was created as: CREATE TABLE people (id INT NOT NULL AUTO INCREMENT PRIMARY KEY, firstname VARCHAR(30), lastname VARCHAR (30), spouse id INT, CONSTRAINT spouse fk FOREIGN KEY (spouse id) REFERENCES people (id)); This is some sample data: Participation Activity 9 +---- | id | firstname | lastname | spouse_id | + 1 | Marty 2 | Jennifer | McFly | Parker | McFly | Tannen | McFly | | 3 | Lorraine 4 | Biff 5 | George NULL | NULL | 5 | NULL | 3 | +----+--arrow_forwardRefer the image and write a sql program as per the question. Don't create any database. Please start your code directly with Select option. The sql program should run on Mysql. An upvote for correct sql program. Just type the correct sql code.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