Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bug Catcher 1 Answer: Values!

Similar presentations


Presentation on theme: "Bug Catcher 1 Answer: Values!"— Presentation transcript:

1 Bug Catcher 1 Answer: Values!
insert into tblMovie value(1,'Anaconda',105) insert into tblMovie value(2,'BraveHeart', 230) Answer: Values! insert into tblMovie values(1,'Anaconda',105) insert into tblMovie values(2,'BraveHeart', 230)

2 Bug Catcher 2 Answer: Update needs SET keyword.
UPDATE tblMovie, m_title = 'Bonker Bonzo' WHERE m_id = 2 Answer: Update needs SET keyword. UPDATE tblMovie SET m_title = 'Bonker Bonzo' WHERE m_id = 2

3 Bug Catcher 3 Answer: WHERE and SET keywords are reversed.
UPDATE tblMovie WHERE m_title = 'Bonker Bonzo' SET m_id = 2 Answer: WHERE and SET keywords are reversed. UPDATE tblMovie SET m_title = 'Bonker Bonzo' WHERE m_id = 2

4 Bug Catcher 4 UPDATE sd SET sd.UnitPriceDiscount = 0.1
FROM SalesOrderHeader sh WHERE sh.SalesPersonID = 275 Answer: The table you are updating must also be listed after the FROM clause. UPDATE sd SET sd.UnitPriceDiscount = 0.1 FROM SalesOrderHeader sh INNER JOIN SalesOrderDetail sd ON sd.SalesOrderID = sh.SalesOrderID WHERE sh.SalesPersonID = 275

5 Bug Catcher 5 Answer: Create table (Not database).
CREATE DATABASE dbMovie GO USE dbMovie CREATE DATABASE tblMovie (m_Id int PRIMARY KEY, M_Title varchar(50) NOT NULL) Bug Catcher 5 Answer: Create table (Not database). CREATE TABLE tblMovie (m_Id int PRIMARY KEY, M_Title varchar(50) NOT NULL)

6 Bug Catcher 6 DROP needs to have DATABASE. No quotes after DATABASE
(5 bugs) USE MASTER GO IF EXISTS(SELECT * FROM Sys.Sysdatabases WHERE [Name] = 'dbMovie') DROP 'dbMovies' GONE CREATE DATABASE dbMovies USE DATABASE dbMovies DROP needs to have DATABASE. No quotes after DATABASE USE should not have DATABASE keyword. GONE should be GO dbMovie vs dbMovies


Download ppt "Bug Catcher 1 Answer: Values!"

Similar presentations


Ads by Google