Question

Sales DateAcquired AcquisitionPrice AskingPrice DateSold SalesPrice Client ClientID Artwork LastName FirstName Street City St

Write one DDL statement to add ‘C_999’ as a new constraint in Sales. This constraint ensures that no sale has a SalesPrice value higher than AskingPrice value. This statement should only affect new Artwork WorkID Title Copy Medium Description ArtistID Client ClientID LastName FirstName Street City State ZipPostalCode Country AreaCode PhoneNumber Email Sales DateAcquired AcquisitionPrice AskingPrice DateSold SalesPrice ClientID WorkID rows inserted into Sales in the future but not existing rows. If constraint ‘C_999’ needs to be deleted from Sales now, what DDL statement would you execute?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

All the tables have to be created first and data can be inserted.To add constraint to the table we have to alter the table and add constraint.

C_999 is the name of the constraint which is used to delete the constraint also.

-To add constraint

ALTER TABLE Sales
ADD CONSTRAINT C_999 CHECK (SalesPrice>AskingPrice);

-To delete the constraint.

ALTER TABLE Sales
DROP CONSTRAINT C_999;

Add a comment
Know the answer?
Add Answer to:
Write one DDL statement to add ‘C_999’ as a new constraint in Sales. This constraint ensures that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose ‘ON UPDATE CASCADE’ is included in a foreign key constraint of AWS. Explain its actual...

    Suppose ‘ON UPDATE CASCADE’ is included in a foreign key constraint of AWS. Explain its actual meaning and implication in AWS. Sales DateAcquired AcquisitionPrice AskingPrice DateSold SalesPrice Client ClientID Artwork LastName FirstName Street City State ZipPostalCode Country AreaCode PhoneNumber Email WorkID Title Copy Medium Description ArtistID ClientlD WorkID

  • Create an SQL Query to show how many customers there are in each state. Sample results ST CUST_C...

    Create an SQL Query to show how many customers there are in each state. Sample results ST CUST_COUNT -- ---------- CA          1 GA          1 CO          2 DC          1 WA          4 BC          1 CUSTOMER CustomerlD ARTIST TRANS WORK SArtistID LastName PURCHASES/SOLD TO Q TransactionID ACQUIRED OworkID CREATES/CREATEDBY FirstName AreaCode LocalNumber Street City State ZipPostalCode Country Email (AK1.1) DateAcquired AcquisitionPrice DateSold SalesPrice AskingPrice WorkID (FK) CustomerlD (FK) Title (AK1.1) o- Copy (AK1.2) Medium Description ArtistID (FK) LastName (AK1.1) FirstName (AK1.1) Nationality DateOfBirth...

  • Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys...

    Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys Exercise                                                                                In Lab 09, we will continue the practice of creating tables. You will need to write SQL statements for the tasks specified below. After you complete them, submit your SQL script (in one *.sql file) to Blackboard by 11:59pm Nov. 16 (Friday). Include your name as a comment in the SQL script submitted. The creation statement for each table is worth one point,...

  • Hi i need Help. i use MYSQL command line. THE QUESTION ARE BELOW please check the...

    Hi i need Help. i use MYSQL command line. THE QUESTION ARE BELOW please check the answer before you submit because sometimes query gives error thank you For Full database of SQL you can DOWNLOAD from this link: https://drive.google.com/file/d/1xh1TcBfMtvKoxvJr7Csgnts68fF53Q1t/view?usp=sharing ------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- What are the total sales for each year. Note that you will need to use the YEAR function. Order by year with the newest year first. ------------------------------------------------------- How many employees have no customers? ------------------------------------------------------------------ List the total sales for...

  • SQL: The schema name should be mxxws, where mxx is your MySQL user name. To refresh...

    SQL: The schema name should be mxxws, where mxx is your MySQL user name. To refresh your memory – here is the schema for that database: Create the rest of the contact management database by writing the statements that do each of the following items below. For each one: (1) execute them on your copy of the database, and (2) write the statements in the space: Statement to create the Contact table (one statement) Statement to create the Employee table...

  • I NEED TO WRITE THE FOLLOWING QUERIES IN MYSQL (13)Next, grant to a user admin the read privileges on the complete descr...

    I NEED TO WRITE THE FOLLOWING QUERIES IN MYSQL (13)Next, grant to a user admin the read privileges on the complete descriptions of the customers who submitted no orders. For example, these are the customers who registered themselves and submitted no orders so far. The granted privilege cannot be propagated to the other users. 0.3 (14)Next, grant to a user admin the read privileges on information about the total number of orders submitted by each customer. Note, that some customers...

  • 1. Which of the following statement is not true regarding sales tax: a)Sales tax is a...

    1. Which of the following statement is not true regarding sales tax: a)Sales tax is a consumption tax b)Sales tax applies to the sale of certain goods and services c) Sales tax is levied at the point of sale d)Sales tax is collected by the retailer and passed on to the government e)Consumers pay sales tax directly to the state f) If a business fails to collect sales tax from a consumer, they are still responsible for paying the uncollected...

  • Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara...

    Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax retum, including Form 1040 and all appropri- ate forms, schedules, or worksheets. Answer the questions following the scenario. Note: When entering Social Security numbers (SSNS) or Employer identification Numbers (EINS), replace the Xs as directed, or with any four digits of your choice. Interview Notes • Mark and Barbara are married and want to file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT