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 4, Problem 20MC
Which of the following is the valid syntax for adding a PRIMARY KEY constraint to an existing table?
- a. ALTER TABLE tablename ADD CONSTRAINT PRIMARY KEY (columnname);
- b. ALTER TABLE tablename ADD CONSTRAINT (columnname) PRIMARY KEY constraintname;
- c. ALTER TABLE tablename ADD [CONSTRAINT constraintname] PRIMARY KEY;
- d. None of the above is valid syntax.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Which of the following is the valid syntax for adding a PRIMARY KEY constraint to an existing table? ( refer to the tables in the JustLee Books database). a. ALTER TABLE tablename ADD CONSTRAINT PRIMARY KEY (columnname); b. ALTER TABLE tablename ADD CONSTRAINT (columnname) PRIMARY KEY constraintname; c. ALTER TABLE tablename ADD [CONSTRAINT constraintname] PRIMARY KEY; d. None of the above is valid syntax.
Given the following tables, there is a university rule preventing a student from enrolling in a new class if there is an unpaid fine. Please write a table-level CHECK constraint to implement the rule. */ create table Course (CourseID int primary key, CourseName varchar(50), InstructorID int, AcademicYear int, Semester smallint); create table Student (StudentID int primary key, LastName varchar (50), FirstName varchar (50), Email varchar(30), PhoneNumber varchar (20)); create table Enrollment (CourseID int references Course(CourseID), StudentID int references Student(StudentID), RegisterDate date, primary key (CourseID, StudentID)); create table Fine (StudentID int references Student(StudentID), IssueDate date, Amount money, PaidDate date primary key (StudentID, IssueDate));
True or False?
An action query is accomplished by putting AS and an alternative name after the table name in the FROM clause.
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
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
- Which 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_forwardSuppose you created a PRIMARY KEY constraint at the same time you created a table and later decide to name the constraint. Which of the following commands can you use to change the constraint’s name? ALTER TABLE … MODIFY ALTER TABLE … ADD ALTER TABLE … DISABLE None of the above commands can be used.arrow_forwardWhich of the following characters can be used in a table name? a. b. ( c. % d. !arrow_forward
- Explain the difference between truncating a table and deleting a table.arrow_forwardHow many NOT NULL constraints can be created at the table level by using the CREATE TABLE command? 0 1 12 30 255arrow_forwardWhat is the maximum number of PRIMARY KEY constraints allowed for a table? a. 1 b. 2 c. 30 d. 255arrow_forward
- What is the maximum number of columns you can define as a primary key when using the column-level approach to creating a table? a. 0 b. 1 c. 30 d. 255arrow_forwardAdd a constraint to make sure the Rep_ID value entered in the BOOK_STORES table is a valid value contained in the STORE_REPS table. The Rep_ID columns of both tables were initially created as different datatypes. Does this cause an error when adding the constraint? Make table modifications as needed so that you can add the required constraint.arrow_forwardWhich of the following commands can you use to rename a constraint? RENAME ALTER CONSTRAINT MOVE NEW NAME None of the above commands can be used.arrow_forward
- When must you define constraints at the table level rather than the column level?arrow_forwardWhich type of constraint can be used to make certain the category for a book is included when a new book is added to inventory?arrow_forwardWhich of the following is not a correct statement? A table can be modified only if it doesn’t contain any rows of data. The maximum number of characters in a table name is 30. You can add more than one column at a time to a table. You can’t recover data contained in a table that has been truncated.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase 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 Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
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
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY