Consider two tables, Sells and Beers, with the following sch…
Consider two tables, Sells and Beers, with the following schema: CREATE TABLE Beers ( name VARCHAR(50) PRIMARY KEY, manf VARCHAR(50)); CREATE TABLE Sells ( bar VARCHAR(50), beer VARCHAR(50), price DECIMAL(5,2), FOREIGN KEY (beer) REFERENCES Beers(name)); What happens if the following INSERT statement is executed? INSERT INTO Beers(name, manf) VALUES (‘Bud Light’, ‘Anheuser’);
Read DetailsConsider the relation Sells (bar, beer, price) and the follo…
Consider the relation Sells (bar, beer, price) and the following view that has been created: CREATE VIEW ExpensiveBeers AS SELECT DISTINCT beer, price FROM Sells WHERE price > 5.00; What happens when you attempt to update the ExpensiveBeers view?
Read DetailsGiven this trigger: CREATE TRIGGER RoundPriceBEFORE INSERT…
Given this trigger: CREATE TRIGGER RoundPriceBEFORE INSERT ON SellsFOR EACH ROWSET NEW.price = ROUND(NEW.price); A User attempts to execute the following statement on Sells (Bar, Beer, Price): INSERT INTO Sells (bar, beer, price) VALUES (‘Joe”s Bar’, ‘Corona’, 4.75); What will happen to the price value inserted into the Sells table?
Read DetailsConsider two tables, Sells and Beers, with the following sch…
Consider two tables, Sells and Beers, with the following schema: CREATE TABLE Beers ( name VARCHAR(50) PRIMARY KEY, manf VARCHAR(50)); CREATE TABLE Sells ( bar VARCHAR(50), beer VARCHAR(50), price DECIMAL(5,2), FOREIGN KEY (beer) REFERENCES Beers(name)); What happens if the Beer table had a record of Bud Light and the following Delete statement is executed? Delete from Sells Where beer = ‘ Bud Light’
Read Details