Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6. Add a new column PositionResponsibilities of type VARCHAR2 into table Positio

ID: 3831499 • Letter: 6

Question

6. Add a new column PositionResponsibilities of type VARCHAR2 into table Position.

7. What does the SQLPLUS command ED do?

8. How can you extract the time portion from a column of type DATE? How can you insert only a time (e.g., 10:15AM) into a column of type DATE? Give examples using the PlayingInScreen table in this database.

9. Modify the check constraint of column ScreenSeatingCapacity of table Screen so that its value is >0 and <250. Use the BETWEEN operator.

10. How can you insert a string containing an '&' and 'single quote' into a column of type varchar2? For example, how to correctly insert the string “Bed, Bath & Beyond is next to Macy's.” into a table TEST with column TEST_COL of type VARCHAR2(100).

11. Drop all the tables in the database in such a way that no foreign key constraint errors occur.

Table: PlayingInScreen Attribute Type Constraint Id Char (8) Screen Pk, Fk (Screen) Theaterld Pk, Fk (Screen) Char (8) Char Movield. Fk (Movie). Pk, Not Null Start Time Date Table: Ticket Attribute Type Constraint Ticket Char (8) Pk. Char (8) Theaterld Pk, Fk (PlayingInScreen) Id Char Screen Pk, Fk (PlayingInScreen) Start Time Date Not Null, Fk PlayingInScreen) Price Number Not Null Staffld Char (8) Fk (Staff SellingTiemstamp Date

Explanation / Answer

[6]

ALTER TABLE Position
ADD PositionResponsibilities VARCHAR2;


[7]
ED[IT] [file_name]
--> Invokes an operating system text editor on the contents of the specified file

[8]

SELECT to_char(StartTime, 'HH24:MI:SS' )
FROM PlayingInScreen

[9]

ADD CONSTRAINT CHK_CAPACITY CHECK (ScreenSeatingCapacity BETWEEN 0 AND 250);

[10]
set define off;
INSERT INTO TEST (Test_col)
VALUES ('Bed, Bath & Beyond is next to Macy''s');


[11]
DROP TABLE StaffSalary;
DROP TABLE StaffPosition;
DROP TABLE Position;
DROP TABLE Theater;
DROP TABLE Staff;
DROP TABLE Ticket
DROP TABLE PlayingInScreen;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote