Oracle 12c: SQL
3rd Edition
ISBN: 9781305251038
Author: Joan Casteel
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 4, Problem 5MC
Program Description Answer
“None of the given commands” is a valid SQL command.
Hence, correct answer is option “E”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Which of the following is a valid SQL command? ( refer to the tables in the JustLee Books database). a. ALTER TABLE books ADD CONSTRAINT UNIQUE (pubid); b. ALTER TABLE books ADD CONSTRAINT PRIMARY KEY (pubid); c. ALTER TABLE books MODIFY (pubid CONSTRAINT NOT NULL); d. ALTER TABLE books ADD FOREIGN KEY CONSTRAINT (pubid) REFERENCES publisher (pubid); e. None of the above commands is valid.
THIS MODULE IS ABOUT SUBQUERIES, SO YOU MUST USE SUBQUERIES INSTEAD OF TABLE JOINS
(a) From which two fields in which table can you calculate the enrollment of a section?(b) From which table can you get both course and section numbers?(c) Which field in table SECTION uniquely identifies a section, section id or section no?(d) Write a SQL statement to show sections and their enrollment.(e) Write a SQL statement to show sections with enrollment greater than five. Display both course andsection numbers
Which of the following SQL statements is invalid and returns an error message? ( refer to the tables in the JustLee Books database).
a. ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); b. ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); c. ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); d. ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); e. All of the above statements are invalid
Chapter 4 Solutions
Oracle 12c: SQL
Ch. 4 - What is the difference between a PRIMARY KEY...Ch. 4 - How can you verify the constraints that exist for...Ch. 4 - A table can have a maximum of how many PRIMARY KEY...Ch. 4 - Which type of constraint can be used to make...Ch. 4 - Which type of constraint should you use to ensure...Ch. 4 - How is adding a NOT NULL constraint to an existing...Ch. 4 - When must you define constraints at the table...Ch. 4 - Prob. 8RQCh. 4 - What is the difference between disabling a...Ch. 4 - Prob. 10RQ
Ch. 4 - Prob. 1MCCh. 4 - Which of the following is not a valid constraint...Ch. 4 - Which of the following SQL statements is invalid...Ch. 4 - What is the maximum number of PRIMARY KEY...Ch. 4 - Prob. 5MCCh. 4 - How many NOT NULL constraints can be created at...Ch. 4 - The FOREIGN KEY constraint should be added to...Ch. 4 - What is the maximum number of columns you can...Ch. 4 - Which of the following commands can you use to...Ch. 4 - Prob. 10MCCh. 4 - In the initial creation of a table, if a UNIQUE...Ch. 4 - Which type of constraint should you use on a...Ch. 4 - Which of the following commands can be used to...Ch. 4 - Which of the following keywords allows the user to...Ch. 4 - Which of the following data dictionary objects...Ch. 4 - Which of the following types of constraints cant...Ch. 4 - Suppose you created a PRIMARY KEY constraint at...Ch. 4 - You’re creating a new table consisting of three...Ch. 4 - Which of the following types of restrictions can...Ch. 4 - Which of the following is the valid syntax for...Ch. 4 - Prob. 1HOACh. 4 - Prob. 2HOACh. 4 - Prob. 3HOACh. 4 - Add a column named Base_salary with a datatype of...Ch. 4 - Create a table named BOOK_STORES to include the...Ch. 4 - Add a constraint to make sure the Rep_ID value...Ch. 4 - Change the constraint created in Assignment #6 so...Ch. 4 - Create a table named REP_CONTRACTS containing the...Ch. 4 - Produce a list of information about all existing...Ch. 4 - Issue the commands to disable and then enable the...
Knowledge Booster
Similar questions
- Which of the following SQL statements is invalid and returns an error message? ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); All of the above statements are invalid.arrow_forwardWhich of the following commands can be used to enable a disabled constraint? a. ALTER TABLE MODIFY b. ALTER TABLE ADD c. ALTER TABLE DISABLE d. ALTER TABLE ENABLEarrow_forwardWhich of the following characters can be used in a table name? a. b. ( c. % d. !arrow_forward
- Which of the following is a valid SQL statement?a. ALTER TABLE secustomersspent ADD DATE lastorder;b. ALTER TABLE secustomerorders DROP retail;c. CREATE TABLE newtable AS (SELECT * FROM customers);d. ALTER TABLE drop column *;arrow_forwardWhich of the following statements is correct? ( refer to the tables in the JustLee Books database). a. A PRIMARY KEY constraint allows NULL values in the primary key column(s). b. You can enable a dropped constraint if you need it in the future. c. Every table must have at least one PRIMARY KEY constraint, or Oracle 12 c doesn’t allow the table to be created. d. None of the above statements is correctarrow_forwardThe given SQL creates a Movie table and inserts some movies. The SELECT statement selects all movies. Press the Run button to produce a result table. Verify the result table displays five movies. Modify the SELECT statement to only select movies released after October 31, 2015: SELECT*FROM Movie WHERE ReleaseDate >'2015-10-31'; Then run the SQL again and verify the new query returns only three movies, all with release dates after October 31, 2015. CREATE TABLE Movie ( ID INT, Title VARCHAR(100), Rating VARCHAR(5), ReleaseDate DATE); INSERT INTO Movie VALUES (1, 'Rogue One: A Star Wars Story', 'PG-13', '2016-12-10'), (2, 'Hidden Figures', 'PG', '2017-01-06'), (3, 'Toy Story', 'G', '1995-11-22'), (4, 'Avengers: Endgame', 'PG-13', '2019-04-26'), (5, 'The Godfather', 'R', '1972-03-14'); -- Modify the SELECT statement:SELECT *FROM Movie;Where ReleaseDate > '2015-10-31';arrow_forward
- Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table? a. Create table EMP (empno number(4), ename varchar2(35), deptno number(7,2) not null constraint emp_deptno_fk FOREIGN KEY deptno refrences dept deptno); b. Create table EMP (empno number(4) primary key, ename varchar2(35), deptno number(7,2) foreign key constraint emp deptno fk REFERENCES dept(deptno)); c. Create table EMP (empno number(4) ,ename varchar2(35), deptno number(7,2) Not Null constraint emp_deptno_fk REFERENCES dept(deptno) foreign key(deptno)); d. Create table EMP (empno number(4) primary key, ename varchar2(35), deptno number(7,2) constraint emp_deptno_fk REFERENCES dept(deptno)); Just answer without explanation pleasearrow_forwardHow do I do this question in SQL command? Use the Oracle database employees table and CASE expression to decode the departmentid. Display the department id, last name, salary, and a column called “New Salary” whose value is based on the following conditions: If the department id is 10 then 1.25 * salary If the department id is 90 then 1.5 * salaryIf the department id is 130 then 1.75 * salary Otherwise, display the old salary.arrow_forwardDatabase Q1: Select the correct SQL statement to provide the user Samer with read only permission on Employees table a) Grant read on Employee where username = Samer; b) Grant read only on Employee to Samer; c) Grant select to Samer on Employee; d) Grant select on Employee to Samer; Q2: Based on the TWO schema structures below, which SQL statement will create a view to show department names where each department has at least 5 employees? Employee (E_ID, E_Name, D_ID, E_Salary) Department (D_ID, D_Name, D_Address) (Select one) a) Create View Dept_Emp as select D_Name, count(E_ID) from Employee, Department where Employee D_ID = Department D_ID Group by D_Name Where count (E_ID) >= 5; b) Create View Dept_Emp as select D_Name, count(E_ID) from Employee D_ID = Department D_ID Group by D_Name Having count (E_ID) >= 5; c) Create View Dept_Emp as select D_Name, count(D_ID) from Employee, Department where Employee D_ID = Department D_ID Group by D_Name Having count (E_ID) >= 5; d)…arrow_forward
- Q3: How many unique titles do we have in the employee table? Hint: You need to create TWO queries, 1. The first query returned all the unique titles, i.e., Q03_Unique Titles (use the Distinct keyword and use the SQL View to type in the SQL statement directly (Design View will not work). Please refer to SQL_MIS310 slide#105-107 for guidance. You cannot use Distinct and Count together in Access and this is why you have to do it in two related two queries.). The second query is a query against the first query (i.e., Q03_UniqueTitles) and count the number of unique titles (Use the aggregate function Count) and the query should return a number. 2. The second query is named Q03_UniqueTitlles_Count and it has been created for you already. You should use Q03_UniqueTitles (not a table) to create this query. This query should return a result that is a simple number.arrow_forwardMS SQL server Create a Stored Procedures with the name of “usp_CalculateTotals”. usp_CalculateTotals should take three parameters: a client’s social security number (input parameter), mode (input parameter), and the total (output parameter). If the mode is 1, it should calculate the total balance of all the accounts of the client. If the mode is 2, it should calculate the total withdrawal amounts the client has done, and if the mode is 3, it should calculate the total deposit amounts the client has done. Implement the stored procedure below:arrow_forwardQ1. Write a SQL command for following:i) Student( roll_no,name, address, phone_number).a) Add primary key constraint on roll_no and unique constraint on phone number.b) Display the record of student whose name contains ‘a’ character.ii) create new user ‘user1’ and set password ‘user123’.a) Assign select permission on student table which is created by user ‘system’ to ‘user1’ and ‘user1’ should be able to assign same permission to other usersb) Revoke all the permission of ‘user1’ and also revoke the permissions which are issued by ‘user1’ to other users.iii) Consider the following database:Employee(emp_id,name,dept_id,job,email,mobile_number,join_date,salary,mgr_id)Department(dept_id,dept_name,block_no);a) Query to display each department name ,number of employees in the department and the average salary for all the employees in that department.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 PtrDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning