Using the table below, Write 2 simple/short TRIGGER STATEMENTS (WITH GOOD BUSINESS VALUE),
After writing the trigger statements, please comment on what the TRIGGER IS DOING.
CREATE TABLE STUDENT_TBL
(
STU_ID NUMBER (8) NULL,
F_NAME VARCHAR (20)
NULL,
L_NAME VARCHAR (30)
NULL,
STU_MAJOR VARCHAR (20)
NULL,
STU_ADDR VARCHAR (50) NULL,
STU_EMAIL VARCHAR (30) NULL,
CONSTRAINT PKSTU primary key (STU_ID)
);
DESCRIBE STUDENT_TBL;
CREATE TABLE ENROLL_TBL
(
ENR_ID NUMBER (8),
ENR_DATE DATE (10) NULL,
ENR_LOCATION VARCHAR (10)
NULL,
ENR_GRADE VARCHAR (10) NULL,
CL_ID VARCHAR (10) NULL,
CONSTRAINT PKENR primary key (ENR_ID),
);
DESCRIBE ENROLL_TBL;
CREATE TABLE CLASS_TBL
(
CL_ID NUMBER (8),
CL_SECTION VARCHAR (10) NULL,
CL_TIME VARCHAR (18) NULL,
ROOM_CAPACITY VARCHAR (10) NULL,
PROFESSOR_ID VARCHAR (10) NULL,
CONSTRAINT PKCL primary key
(CL_ID),
CONSTRAINT FKPROF foreign key (PROF_ID)
references PROFESSOR,
CONSTRAINT FKRMCAPACITY foreign key
(ROOM_CAPACITY) references ROOM
);
DESCRIBE CLASS_TBL;
CREATE TABLE COURSE_TBL
(
CRS_ID NUMBER (8),
CRS_DESCRIPTION VARCHAR (20) NULL,
CRS_NAME VARCHAR (20)
NULL,
CRS_CREDIT VARCHAR (5)
NULL,
CRS_LOCATION VARCHAR (10)
NULL,
CONSTRAINT PKCRS primary key (CRS_ID)
);
DESCRIBE COURSE_TBL;
CREATE TABLE PROFESSOR_TBL
(
PROF_ID NUMBER,
PROF_FNAME VARCHAR (10)
NULL,
PROF_LNAME VARCHAR (20)
NULL,
PROF_EMAIL VARCHAR (30) NULL,
PROF_DEPT VARCHAR (20) NULL,
PROF_PHONE VARCHAR (18) NULL,
CONSTRAINT PKPROF primary key (PROF_ID)
);
DESCRIBE PROFESSOR_TBL;
CREATE TABLE ROOM_TBL
(
RM_ID
NUMBER,
RM_NAME VARCHAR (10)
NULL,
RM_TYPE VARCHAR (20)
NULL,
RM_TIME VARCHAR (18) NULL,
RM_CAPACITY VARCHAR (10) NULL,
CONSTRAINT PKRM primary key (RM_ID)
);
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
Using the table below, Write 2 simple/short TRIGGER STATEMENTS (WITH GOOD BUSINESS VALUE), After writing the...
-- Schema definition
create table Customer (
cid smallint not null,
name varchar(20),
city varchar(15),
constraint customer_pk
primary key (cid)
);
create table Club (
club varchar(15) not null,
desc varchar(50),
constraint club_pk
primary key
(club)
);
create table Member (
club varchar(15) not null,
cid
smallint not null,
constraint member_pk
primary key (club,
cid),
constraint mem_fk_club
foreign key (club)
references Club,
constraint mem_fk_cust...
SQL Query Question: I have a database with the tables below, data has also been aded into these tables, I have 2 tasks: 1. Add a column to a relational table POSITIONS to store information about the total number of skills needed by each advertised position. A name of the column is up to you. Assume that no more than 9 skills are needed for each position. Next, use a single UPDATE statement to set the values in the new...
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...
CREATE TABLE Gender ( gender CHAR(1), description VARCHAR(10), PRIMARY KEY (gender) ); CREATE TABLE People ( ID INT, name VARCHAR(50), gender CHAR(1), height FLOAT, PRIMARY KEY (ID), FOREIGN KEY (gender) REFERENCES Gender (gender) ); CREATE TABLE Sports ( ID INT, name VARCHAR(50), record FLOAT, PRIMARY KEY (ID), UNIQUE (name) ); CREATE TABLE Competitions ( ID INT, place VARCHAR(50), held DATE, PRIMARY KEY (ID) ); CREATE TABLE Results ( peopleID INT NOT NULL, competitionID INT NOT NULL, sportID INT NOT NULL,...
Create a new database and execute the code below in SQL Server’s query window to create the database tables. CREATE TABLE PhysicianSpecialties (SpecialtyID integer, SpecialtyName varchar(50), CONSTRAINT PK_PhysicianSpecialties PRIMARY KEY (SpecialtyID)) go CREATE TABLE ZipCodes (ZipCode varchar(10), City varchar(50), State varchar(2), CONSTRAINT PK_ZipCodes PRIMARY KEY (ZipCode)) go CREATE TABLE PhysicianPractices (PracticeID integer, PracticeName varchar(50), Address_Line1 varchar(50), Address_Line2 varchar(50), ZipCode varchar(10), Phone varchar(14), Fax varchar(14), WebsiteURL varchar(50), CONSTRAINT PK_PhysicianPractices PRIMARY KEY (PracticeID), CONSTRAINT FK_PhysicianPractices_ZipCodes FOREIGN KEY (ZipCode) REFERENCES Zipcodes) go CREATE...
Write an SQL query to return the users who posted the most number of jokes on 1/1/2019. Database: create table User( userid varchar(30) not null, password varchar(30), firstname varchar(30), lastname varchar(50), email varchar(50), gender char(1), age integer, banned boolean, primary key(userid), unique(email)); create table MyFriends( userid varchar(30), friendid varchar(30), primary key(userid,friendid), foreign key(userid) references User, foreign key(friendid) references User(userid)); Create table Jokes( Jokeid integer, title varchar(100), description varchar(255), authorid varchar(30) not null, primary key(jokeid), posttime Datetime, foreign key(authorid) references User(userid));...
The following SQL DDL script creates a database for a social network application. create table userProfile( id char(10) primary key, firstName varchar(20), lastName varchar(20), dob date, email varchar(30) ); create table foaf( userid char(10), friendID char(10), timeEstablished date, constraint pk primary key(userid, friendID), constraint fk1 foreign key(userid) references userProfile(id), constraint fk2 foreign key(friendID) references userProfile(id) ); create table activity( actID char(20) primary key, topic varchar(20), description varchar(100), location varchar(20), ActivityDate date, hostUser char(10), foreign key(hostUser) references userProfile(id) ); create table...
Hello, Does anyone have any input on how to fragment this table in visual studio? CREATE TABLE [dbo].[Stock] ( [itemNo] INT NOT NULL , [store] VARCHAR(50) NOT NULL, [qtyOnHand] INT NULL, [qtyHand] INT NULL, [qtyOnOrder] INT NULL, [reorderPoint] INT NULL, CONSTRAINT [FK_Stock_Item] FOREIGN KEY ([itemNo]) REFERENCES [Item]([itemNo]), CONSTRAINT [FK_Stock_Store] FOREIGN KEY ([store]) REFERENCES [Store]([storeName]), CONSTRAINT [PK_Stock] PRIMARY KEY ([itemNo], [store]), The other tables are: CREATE TABLE [dbo].[Item] ( [itemNo] INT NOT NULL PRIMARY KEY, [itemName] VARCHAR(50) NULL, [supplier] VARCHAR(50) NULL,...
Based on reference below. Write a relational algebra expression to return those users who have posted “excellent” reviews but never “poor” reviews. CREATE TABLE Users ( userId varchar (30) NOT NULL, pass varchar (30), fname varchar (50), lname varchar (50), email varchar (50), gender char(1), age integer, banned boolean, PRIMARY KEY (userId), UNIQUE(email)) CREATE TABLE FavSellers ( userId varchar (30), sellerId varchar (30), PRIMARY KEY (userId, sellerId),...