Suppose ‘ON UPDATE CASCADE’ is included in a foreign key constraint of AWS. Explain its actual meaning and implication in AWS.
ON UPDATE CASCADE is a clause which means any update that is done on the table will be reflected in the dependent tables and views so that synchronization is provided in the database.
if update is not done the tables show different values in different attributes which causes integrity problems.
Suppose ‘ON UPDATE CASCADE’ is included in a foreign key constraint of AWS. Explain its actual...
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...
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 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,...
An online company sells hundreds of office supply products on
its e-Commerce store. It has asked you to design and implement a
sales order processing system which will be used by users in our
Operations department to process sales orders. Here is an overview
of the sales order process. Customers make purchases by placing
orders. Each customer has a customer number and profile (such as
name, shipping address). To simplify the matter, each time an order
is placed, only one...
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...
The primary keys are underlined.
The foreign keys are denoted by asterisks (*).
Description of the schema:
• person — keeps track of the people who borrow books from the
library. The attributes contain personal and contact
information.
• author — keeps track of personal information about authors.
• publisher — keeps track of the publisher information. To keep it
simple, most of the attributes have been truncated in the sample
database. 1 trivial dependencies are things like X→X or...