Question: A select statement with that includes at least two aggregate functions A select statement that uses at least one join, concatenation, and distinct clause A
A select statement with that includes at least two aggregate functions
A select statement that uses at least one join, concatenation, and distinct clause
A select statement that includes at least one subquery
A select statement that uses an order by clause
An insert statement that runs a trigger in which the trigger adds data or updates data in a table
A delete statement that runs a trigger in which the trigger deletes data in one table.
User Table
CREATE TABLE User
userid VARCHAR PRIMARY KEY, Unique identifier for the user
email VARCHAR NOT NULL UNIQUE, User's email address
createdtime DATETIME NOT NULL, When the user account was created
password VARCHAR NOT NULL, User's password hashed
displayname VARCHAR Display name for the user
phonenumber VARCHAR User's phone number
isadmin BOOLEAN DEFAULT COMMENT NonAdmin, Admin' Role indicator
;
Admin Table
CREATE TABLE Admin
adminid VARCHAR PRIMARY KEY, Unique identifier for the admin
userid VARCHAR NOT NULL UNIQUE, References a User who is an Admin
createdat DATETIME NOT NULL, When the admin privileges were granted
canmanagecalendars BOOLEAN DEFAULT COMMENT 'Permission to manage calendars',
canmanageevents BOOLEAN DEFAULT COMMENT 'Permission to manage events',
FOREIGN KEY userid REFERENCES Useruserid Foreign key to User table
;
Calendar Table
CREATE TABLE Calendar
calendarid VARCHAR PRIMARY KEY, Unique identifier for the calendar
calendarname VARCHAR NOT NULL, Descriptive name of the calendar
createdat DATETIME NOT NULL, When the calendar was created
createdby VARCHAR NOT NULL, References the Admin who manages this calendar
FOREIGN KEY createdby REFERENCES Adminadminid Foreign key to Admin table
;
Event Table
CREATE TABLE Event
eventid VARCHAR PRIMARY KEY, Unique identifier for the event
starttime DATETIME NOT NULL, Start time of the event
endtime DATETIME NOT NULL, End time of the event
description VARCHAR NOT NULL, Description of the event
dayofweek VARCHAR Day of the week optional
CHECK starttime endtime Constraint to ensure event times are valid
;
CalendarEvent Table ManytoMany Relationship
CREATE TABLE CalendarEvent
calendarid VARCHAR References the Calendar table
eventid VARCHAR References the Event table
PRIMARY KEY calendarid eventid Composite primary key
FOREIGN KEY calendarid REFERENCES Calendarcalendarid Foreign key to Calendar table
FOREIGN KEY eventid REFERENCES Eventeventid Foreign key to Event table
;
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
