Question: Writing SQL Statements for the following tasks 1 . Create a table named yourfirstname _ store _ reps with the following columns: CREATE TABLE yourfirstname
Writing SQL Statements for the following tasks
Create a table named yourfirstnamestorereps with the following columns:
CREATE TABLE yourfirstnamestorereps
repid NUMBER
last VARCHAR
first VARCHAR
comm CHAR;
Modify the table so that repid is the PRIMARY KEY and the comm column has a default value of YThe comm column indicates whether the sales representative earns commission
Write your SQL code here.
Modify the yourfirstnamestorereps table to ensure that NULL values cannot be entered in the first and last columns.
Write your SQL code here.
Modify the yourfirstnamestorereps table so that only a Y or N can be entered in the comm column.
Write your SQL code here.
Add a column named basesalary with a datatype of NUMBER to the yourfirstnamestorereps table. Ensure that values entered are above zero.
Write your SQL code here.
Create a table named yourfirstnamebookstores with the following structure:
Column Names Data Types Constraints
storeid NUMBER PRIMARY KEY
name VARCHAR UNIQUE, NOT NULL
content VARCHAR
repid VARCHAR
Write your SQL code here.
Ensure that the repid in the yourfirstnamebookstores table references a valid value in the yourfirstnamestorereps table. Make necessary modifications if the datatypes of repid are different in both tables.
Write your SQL code here.
Modify the constraint created in the previous question so that deleting a row in the yourfirstnamestorereps table automatically deletes associated rows in yourfirstnamebookstores table
Write your SQL code here.
Create a table named yourfirstnamerepcontracts with the following structure and constraints:
Columns: storeid NUMBER name VARCHAR quarter CHAR repid NUMBER
Assign a composite PRIMARY KEY to repidstoreid and quarter and add FOREIGN KEY constraints to repid and storeid
Write your SQL code here.
Display information about all existing constraints on the yourfirstname storereps table
Write your SQL code here.
Issue commands to disable and then enable the CHECK constraint on the basesalary column added in question
Write your SQL code here.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
