Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 13, Problem 3HOA
Create a view called HOMEWORK13 that includes the columns named Col1 and Col2 from the FIRSTATTEMPT table. Make sure the view is created even if the FIRSTATTEMPT table doesn’t exist.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Create a read-only view, name it as ViewD, that will contain RType and the number of rooms per RType in the ROOMS table.
WEEK 2 ASSIGNMENT
Complete the following exercise:
Using the student table you created in week one insert four rows into your table.
Update the first name to “Luke” and last name to “Plew” for one of the rows you inserted above.
Delete the row you updated above.
Explain how you insert data in one table from another table. Your answer should be a minimum of three sentences in length.
Use the data from the class assignment, ALTER TABLE and add two more columns Phone and email.
Describe the table (show its structure) and drop the country column, describe the table (show structure). Now, create a new table based on the existing table person with the help of a subquery (The new table will contain the data from “person” table) and name the table person_self. Show its output (table created and its structure).
NOTE:
Use the ALTER TABLE command with ADD clause
Use the ALTER TABLE command with DROPCOLUMN clause
Use the CREATE TABLE command with AS (SELECT SUBQUERY) clause
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
- Change the CONTACT view so that no users can accidentally perform DML operations on the view.arrow_forwardCreate a new table maned “Hiking” that includes TripID, NumPersons from Reservation table and Trip Type, Trip Name columns from Trip table where Trip type is “Hiking” .arrow_forwardCREATE OR REPLACE VIEW view_name ASSELECT column1, column2, ...FROM table_nameWHERE condition; in oracle the Drop view DROP VIEW view_name;arrow_forward
- 8. Create a trigger for the Invoices table that automatically inserts the vendor name and address for a paid invoice into a table named ShippingLabels. The trigger should fire any time the PaymentTotal column of the Invoices table is updated. The structure of the ShippingLabels table is as follows: CREATE TABLE ShippingLabels (VendorName varchar(50), VendorAddress1 varchar(50), VendorAddress2 varchar(50), VendorCity VendorState VendorZipCode varchar(50), char(2), varchar(20)); Use this UPDATE statement to test the trigger: UPDATE Invoices SET PaymentTotal = 67.92, PaymentDate = '2020-02-23' WHERE InvoiceID = 100;arrow_forwardRefer to the following statement DROP TABLE IF EXISTS tb1_name; What does a statement based on this syntax do? It prevents a view being generated for a nonexistent table. It drops a table only if it does not contain a NULL value. It generates a warning about a nonexistent table. It prohibits a given table being dropped.arrow_forward15. Open the AttendeeFirstName query in Design View and add criteria to select only those records where the FirstName field value begins with Lau followed by any other letters. Save the changes to the query. Open the query in Datasheet View, confirm that two records appear in the query results, and then close it.arrow_forward
- Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL Primary key is (HorseID, LessonDateTime) If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically. Notes: Table and column names are case sensitive in the auto-grader. Your SQL code does not display any results in Develop mode. Use Submit mode to test your code.arrow_forwardCreate table queries CREATE TABLE Students( StudentID INT NOT NULL PRIMARY KEY, LastName VARCHAR(25) NOt NULL, FirstName VARCHAR(25) NOT NULL, EnrollmentDate DateTime2(0) NOt NULL, GraduationDate Date NULL) CREATE TABLE Courses( CourseID INT NOT NULL PRIMARY KEY, CourseNumber INT NULL, CourseDescription VARCHAR(50) NOT NULL, CourseUnits INT NOT NULL, DepartMentID INT NOT NULL, InstructorID INT NOT NULL) CREATE TABLE StudentCourses( StudentID INT NOT NULL, CourseID INT NOT NULL, PRIMARY KEY(StudentID, CourseID), FOREIGN KEY (StudentID) REFERENCES Students(StudentID), FOREIGN KEY (CourseID) REFERENCES Courses(CourseID)) CREATE TABLE Tuition( PartTimeCost SMALLMONEY NOT NULL, FullTimeCost SMALLMONEY NOT NULL, PerUnitCost SMALLMONEY NOT NULL) arrow_forward Step 3 CREATE FUNCTION fnStudentUnits( @studentID INT)RETURNS INTASBEGIN -- Declare the return variable here DECLARE @totalUnits INT SET @totalUnits = 0 SELECT @totalUnits =…arrow_forward-- 2 - Write a View to show all customer Ids that have placed orders --(Sales.SalesOrderHeader sh and Person. Person are joined on CustomerID = Business EntityID)arrow_forward
- I am working on Task 7. Task 7: Create a view named MONTHLY_RENTS. It consists of three columns: the first is the number of bedrooms, the second is the average square feet, and the third is the average monthly rent for all properties in the PROPERTY table that have that number of bedrooms. Use BEDROOMS, AVG_SQUARE_FEET, and AVG_MONTHLY_RENT as the column names. Group and order the rows by number of bedrooms. Here is Tasks 1-7 and what I wrote for Task 8. When I input Task 8, I am not getting results at all. Expected Results Tables_in_StayWell Table_type MONTHLY_RENTS VIEWarrow_forwardAlter the structure of the table Activities by adding a new column called 'ActivityDescription' of type Varchar2(100). This column will hold the description of each activity.arrow_forwardAdd validation on CTYPE column in CUSTOMERS table. It must accept either ‘New’ or ‘Old’ only.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