Home

Records Maintenance

 

Selecting Records

 

Visually Selecting Records

Records Maintenance

Before visually performing some operations on a table, you must first open the desired table and select one or more records. Remember that, to open the table, you can right-click it in the Object Explorer and click Select Top 1000 Rows.

To visually select a record, in the Table window, to select one record, position the mouse on the left button of the record and click:

Visually Selecting Records

To select a range of records, click the gray button of one of the records, press and hold Shift, then click the gray button of the record at the other extreme.

To select the records in a random fashion, select one record, press and hold Ctrl, then click the gray button of each desired record:

Visually Selecting Records

To select all records of a table, click the gray button on the left of the first column:

Visually Selecting Records

Practical LearningPractical Learning: Introducing Records Maintenance

  1. Start the computer and log in
  2. Launch Microsoft SQL Server and click Connect
  3. In the Object Explorer, expand Databases. Make sure you have the LambdaSquare1 database (if you don't have it, create it by opening the LambdaSquare1.txt file and executing it)
  4. Still in the Object Explorer, right-click LambdaSquare1 and click New Query
  5. To see the list of all units, type:
    SELECT * FROM Presentation.Units;
    GO
  6. To see the result, on the main menu, click Query -> Execute
  7. Click inside the top part of the Query window and press Ctrl + A
  8. To add a new column to the table, type:
    ALTER TABLE Presentation.Units
    ADD UnitType nvarchar(40) null;
    GO
  9. To execute, press F5
  10. Click inside the Query window and press Ctrl + A
  11. To see the list of all units, type:
    SELECT UnitNumber As [Unit #],
           UnitType AS [Type of Unit],
           Bedrooms,
           Bathrooms,
           Price,
           Deposit As [Deposit Amount],
           Available
    FROM Presentation.Units;
    GO
  12. To see the result, on the main menu, click Query -> Execute
     
    Selecting Records
  13. In the Object Explorer, make sure you have the FunDS1 database (if you don't have it, create it by opening the FunDS1.sql file (FunDS1.sql) and executing it)
  14. In the Object Explorer, right-click the name of the server and click Start PowerShell
  15. Type SQLCMD and press Enter
  16. Type USE FunDS1; and press Enter
  17. Type GO and press Enter
  18. Return to SQL Server Management Studio and expand FunDS1
  19. Under FunDS1, expand the Tables node
  20. Right-click Inventory.StoreItems and click Edit Top 200 Rows
  21. On the Query Designer toolbar, click the Show Diagram Pane Show Diagram Pane
  22. On the Query Designer toolbar, click the Show Criteria Pane Show Criteria Pane
  23. On the Query Designer toolbar, click the Show SQL Pane Show SQL Pane
  24. In the SQL pane, delete TOP (200)
  25. Click the box at the intersection of Manufacturer and Filter, type Calvin Klein
  26. To see the result, on the Query Designer toolbar, click the Execute SQL button Execute SQL. Notice that you receive 9 records:
     
    Introducing Records Maintenance
  27. Click the box at the intersection of Manufacturer and Filter, add CK and a space to the left of Calvin Klein
  28. To see the result, on the Query Designer toolbar, click the Execute SQL button Execute SQL. Notice that you get 3 records:

    Introducing Records Maintenance

Programmatically Selecting a Record

To programmatically specify the record you want to work on, you use the WHERE keyword in the following formula:

WHERE ColumnName Operator WhatValue

In reality, an expression is used before the WHERE keyword. In the next sections and future lessons, we will see what types of expressions. After WHERE, you must create a Boolean expression that isolates the record.

Updating Records

 

Introduction

Record maintenance includes viewing records, looking for one or more records, modifying one or more records, or deleting one or more records. These operations can be performed visually or programmatically using a Data Definition Language (DDL) command.

To visually modify one or more records on a table, first open it to view its records. Locate the record and the field you want to work on and perform the desired operation.

Visually Updating a Record

Updating a record consists of changing its value for a particular column. To visually update a record, in the Object Explorer, right-click its table (or view, in some cases) and click Edit Top 200 Rows. This would open the table as a spreadsheet, as seen above. Locate the value under the desired column header, and modify the value as you see fit.

Updating Records

Practical LearningPractical Learning: Visually Updating Records

  1. In the Results pane, under Manufacturer, click the first record, press F2, press Home, press Delete three times, and press Enter
  2. In the same, delete CK and the space in the other records
  3. To see the new result, on the Query Designer toolbar, click the Execute SQL button Execute SQL. The Results pane should be empty:
     
    Visually Updating Records
  4. In the Criteria pane, delete CK and the space
  5. To see the new result, on the Query Designer toolbar, click the Execute SQL button Execute SQL
     
    Visually Updating Records
  6. Close the Query Designer

Programmatically Updating all Records

Updating Records

To programmatically update a record, you use a Data Definition Language (DDL) command. If you are working in Microsoft SQL Server:

  • In the Object Explorer, you can right the table, position the mouse on Script Table As -> UPDATE To -> New Query Editor Window
  • Open an empty Query window and type your code

The DDL command to update a record is UPDATE. The basic formula to use is:

UPDATE TableName SET ColumnName Operator Expression

With this formula, you must specify the name of the involved table as the TableName factor of our formula. The SET statement allows you to specify a new value, Expression, for the field under the ColumnName column.

Consider the following code to create a new database named VideoCollection and to add a table named Videos to it:

CREATE DATABASE VideoCollection;
GO
USE VideoCollection;
GO
CREATE TABLE Videos (
  VideoID INT NOT NULL IDENTITY(1,1),
  VideoTitle nvarchar(120) NOT NULL,
  Director nvarchar(100) NULL,
  YearReleased SMALLINT,
  VideoLength nvarchar(30) NULL,
  Rating nchar(6)
);
GO
INSERT INTO Videos(VideoTitle, Director, YearReleased, VideoLength)
VALUES(N'A Few Good Men','Rob Reiner',1992,'138 Minutes');

INSERT INTO Videos(VideoTitle, Director, VideoLength)
VALUES(N'The Lady Killers', N'Joel Coen & Ethan Coen', N'104 Minutes');

INSERT INTO Videos(VideoTitle, Director, YearReleased, VideoLength)
VALUES(N'The Silence of the Lambs','Jonathan Demme',1991,'118 Minutes');

INSERT INTO Videos(VideoTitle, Director, VideoLength)
VALUES(N'The Distinguished Gentleman', N'James Groeling', N'112 Minutes');

INSERT INTO Videos(VideoTitle, Director, VideoLength)
VALUES(N'Ghosts of Mississippi', N'Rob Reiner', N'130 Minutes');
GO

Imagine you want to indicate that all these videos are rated R. To do this, in our formula, specify the table name. In the SET expression, specify the column name as Rating and assign it R as a string. This would be done as follows:

USE VideoCollection;
GO

UPDATE Videos SET Rating = N'R';
GO 

If you use the UPDATE statement like this, it acts on all records. The above code would produce:

Practical LearningPractical Learning: Updating all Records

  1. Make sure the SQLQuery1.sql tab displays.
    Click inside the Query window and press Ctrl + A
  2. To update all records, type:
    UPDATE Presentation.Units
    SET UnitType = N'Apartment';
    GO
  3. To see the new result, on the SQL Editor toolbar, click the Execute button Execute
  4. Click inside the Query window and press Ctrl + A
  5. To see the list of all units, type:
    SELECT UnitNumber As [Unit #],
           UnitType AS [Type of Unit],
           Bedrooms,
           Bathrooms,
           Price,
           Deposit As [Deposit Amount],
           Available
    FROM Presentation.Units;
    GO
  6. To see the result, on the main menu, click Query -> Execute

Selecting Records

Updating One or Some Records

Editing a record consists of changing a value in a field. It could be that the field is empty, such as the © Year of the the N'The Lady Killers' video of the following table. It could be that the value is wrong, such as the Director of the the N'The Distinguished Gentleman' video of this table:

Video Director © Year Length Rating
A Few Good Men Rob Reiner 1992 138 Minutes R
The Silence of the Lambs Jonathan Demme 1991 118 Minutes  
The Distinguished Gentleman James Groeling   112 Minutes R
The Lady Killers Joel Coen & Ethan Coen   104 Minutes R
Ghosts of Mississippi Rob Reiner   130 Minutes  

To edit a record, first open the table to view its records. Locate the record, the column on which you want to work, and locate the value you want to change, then change it.

To programmatically edit a record, we mentioned earlier that you must use the WHERE keyword to create a Boolean expression that specify what column to use and what value must bee application. In reality, the WHERE expression is preceded by an UPDATE statement. This is done using the following formula:

UPDATE TableName
SET ColumnName = Expression
WHERE Condition(s)

The WHERE operator allows you to specify how the particular record involved would be identified. It is very important, in most cases, that the criterion used be able to uniquely identify the record(s). In the above table, imagine that you want the SQL interpreter to change the released year to 1996 where the director of the video is Rob Reiner. The UPDATE statement would be written as follows:

UPDATE Videos
SET YearReleased = 1996
WHERE Director = N'Rob Reiner';

In the above table, there are at least two videos directed by Rob Reiner. When this statement is executed, all video records whose director is Rob Reiner would be changed, which would compromise existing records that didn't need this change. This is where the identity column becomes valuable. We saw earlier that, when using it with the IDENTITY feature, the interpreter appends a unique value to each record. You can then use that value to identify a particular record because you are certain the value is unique.

Here is an example used to specify the missing copyright year of a particular record:

UPDATE Videos
SET YearReleased = 1996
WHERE VideoID = 5;
GO

The real rule is to make sure that the WHERE condition uniquely identifies a record. Here is an example used to change the name of the director of a particular video:

UPDATE Videos
SET Director = N'Jonathan Lynn'
WHERE VideoTitle = N'The Distinguished Gentleman';

Practical LearningPractical Learning: Updating Some Records

  1. Return to the PowerShell
  2. To see the records that have Anne Klein as the manufacturer, type SELECT ItemNumber, Manufacturer FROM Inventory.StoreItems and press Enter
  3. Type WHERE Manufacturer = N'anne klein'; and press Enter
  4. Type GO and press Enter. Notice that the result includes only 1 record
     
    Updating Some Records
  5. To see the records that have AK Anne Klein as the manufacturer, type SELECT ItemNumber, Manufacturer FROM Inventory.StoreItems and press Enter
  6. Type WHERE Manufacturer = N'ak anne klein'; and press Enter
  7. Type GO and press Enter. Notice that the result includes only 6 records
     
    Updating Some Records
  8. To change the AK Anne Klein records to Anne Klein, type the following lines and press Enter after each line:
    1> UPDATE Inventory.StoreItems
    2> SET Manufacturer = 'Anne Klein'
    3> WHERE Manufacturer = N'AK Anne Klein';
    4> GO
    Updating One or Some Records
  9. Again, to see the records that have Anne Klein as the manufacturer, type
    SELECT ItemNumber, Manufacturer FROM Inventory.StoreItems
  10. Press Enter
  11. Type WHERE Manufacturer = N'anne klein'; and press Enter
  12. Type GO and press Enter. Notice that, this time, the result includes only 7 records
     
    Updating One or Some Records
  13. Return to SQL Server Management Studio and the SQLQuery1.sql tab
 
 
 

Updating a Range of Top Records

Consider the following table named Employees:

USE Exercise;
GO

CREATE TABLE Employees
(
	EmployeeNumber int,
	FirstName nvarchar(20),
	LastName nvarchar(20),
	HourlySalary money
);
GO

INSERT INTO Employees
VALUES(283007, N'Megan',    N'Wright',    8.50),
      (480295, N'Horace',   N'Taylor',   20.25),
      (804805, N'Marc',     N'Knights',  10.85),
      (294117, N'Bryan',    N'Tenant',   30.25),
      (837479, N'Paul',     N'Motto',    18.02),
      (280304, N'Joyce',    N'Holliday', 11.66),
      (924802, N'Peter',    N'Mukoko',    8.68),
      (725381, N'Marianne', N'Brooks',   22.64);
GO

By default, the UPDATE statement checks all records of a table to see which one(s) need(s) to be changed. As an alternative, you can ask the database engine to check only a specify range  of the first records of a table based on a percentage of the number of records. To do this, the formula to use is:

UPDATE TOP (Number) PERCENT TableName
SET ColumnName = Expression
WHERE Condition(s)

Based on this formula, after the UPDATE keyword, use TOP, followed by parentheses, and followed by PERCENT. In the parentheses, enter a value between 0.00 and 100.00 of the percentage of records to check. For example, imagine you want to change the hourly salary of the Employees table but you want to make the changes only for the first 40% of records. You can create an UPDATE expression as follows:

UPDATE TOP (40) PERCENT Employees
SET HourlySalary = 12.50
WHERE HourlySalary < 12.50;
GO

This code asks  the database engine to change the hourly salary of the first 40% employees. Since the table contains 8 records, the top 40% produces 8 / (100 / 40) = 8 / 2.5 = 3.2. Rounding to the highest integer, the expression produces 4. As a result, 4 and only the first 4 records are checked. Even though there are records beyond the fourth where the hourly salary is less than 12.50, only the first four records are checked.

Outputting the Update Result

After making changes to a table using SQL, you don't get a visual display of what happened. With Transact-SQL, you can temporarily display the result of this operation or you can store it in a table. We already saw how to do this when creating records. You follow the same formula when updating records. The formula is:

UPDATE TableName
SET ColumnName = Expression
OUTPUT INSERTED.Columns
VALUES(Value_1, Value_2, Value_X)

Besides the formula we have used so far, after the SET statement, start with an OUTPUT INSERTED expression, followed by a period. If you want to show all columns of the table, add the * operator. Otherwise, type INSERTED followed by a period, followed by the name(s) of the column(s) you want to show.

Practical LearningPractical Learning: Updating Records and Outputting the Result

  1. Notice the prices of apartments:
     
    Selecting Records
     
    Click inside the top section of the Query window and press Ctrl + A
  2. To increase the price on all apartments, type:
    UPDATE Presentation.Units
    SET Price = Price + 45
    OUTPUT INSERTED.*;
    GO
    Selecting Records

Deleting Records

 

Removing all Records

If you think all records of a particular table are, or have become, useless, you can clear the whole table, which would still keep its structure. To delete all records from a table, first select all of them, and press Delete. You would receive a warning:

If you still want to delete the records, click Yes. If you change your mind, click No.

The DDL command to clear a table of all records is DELETE. It uses the following formula:

DELETE [FROM] TableName;

The FROM keyword is optional. When this statement is executed, all records from the TableName factor would be removed from the table. Be careful when doing this because once the records have been deleted, you cannot get them back. Here is an example:

DELETE Employees;
GO

This statement asks the database engine to clear the Employees table of all records. Alternatively, you can precede the name of the table with FROM. Here is an example used to clear the table of all videos:

DELETE FROM Videos;
GO

Removing the First n Records

Instead of removing all records, to delete only the first n of a table, use the following formula:

DELETE TOP (Number) TableName;

In the parentheses, enter the desired number of records. When the statement executes, the first n records of the table would be deleted. Here is an example:

DELETE TOP (2) Employees;
GO

This statement asks the database engine to delete the first two records of the Employees table.

Removing a Specific Record

If you find out that a record is not necessary, not anymore, or is misplaced, you can remove it from a table.

To visually remove a record from a table, open the table in Table view, right-click the gray box of the record and click Delete. You can also first select the record and press Delete. You would receive a warning to confirm your intention.

To programmatically delete a record:

  • In the Object Explorer, right the table, position the mouse on Script Table As -> DELETE To -> New Query Editor Window
  • Open an empty Query window and type your code

In SQL, to delete a record, use the DELETE FROM statement associated with the WHERE operator. The formula to follow is:

DELETE FROM TableName
WHERE Condition(s)

The TableName factor is used to identify a table whose record(s) would be removed.

The Condition(s) factor allows you to identify a record or a group of records that carries a criterion. Once again, make sure you are precise in your criteria so you would not delete the wrong record(s).

Here is an example used to remove a particular record from the table:

DELETE FROM Videos
WHERE VideoTitle = N'The Lady Killers';

Practical LearningPractical Learning: Deleting a Record

  1. Return to the PowerShell
  2. To see the records that have a Joseph as the manufacturer, type SELECT ItemNumber, Manufacturer FROM Inventory.StoreItems and press Enter
  3. Type WHERE Manufacturer LIKE N'joseph%'; and press Enter
  4. Type GO and press Enter. Notice that the result includes only 1 record
     
    Selecting Records
  5. To delete that record, type DELETE FROM Inventory.StoreItems and press Enter
  6. Type WHERE Manufacturer LIKE N'joseph%'; and press Enter
  7. Type GO and press Enter
     
    Deleting a Record
  8. To see the records that have a Joseph as the manufacturer, type SELECT ItemNumber, Manufacturer FROM Inventory.StoreItems and press Enter
  9. Type WHERE Manufacturer LIKE N'joseph%'; and press Enter
  10. Type GO and press Enter. Notice that there is no record
     
    Selecting Records
  11. Type quit and press Enter
  12. Type exit and press Enter

Conditionally Removing the First n Records

Consider the following table:

CREATE TABLE Employees
(
	EmployeeNumber int,
	FirstName nvarchar(20),
	LastName nvarchar(20),
	HourlySalary money
);
GO
INSERT INTO Employees
VALUES(283007, N'Megan',    N'Wright',    8.50),
      (480295, N'Horace',   N'Taylor',   20.25),
      (804805, N'Marc',     N'Knights',  10.85),
      (294117, N'Bryan',    N'Tenant',   30.25),
      (837479, N'Paul',     N'Motto',    18.02),
      (280304, N'Joyce',    N'Holliday', 11.66),
      (924802, N'Peter',    N'Mukoko',    8.68),
      (725381, N'Marianne', N'Brooks',   22.64);
GO

By default, the DELETE expression acts on all records of a table. As an alternative, you can ask the database engine to consider only the first n records of a table. The formula to do this is:

DELETE TOP (Number) FROM TableName
WHERE Condition(s)

In the parentheses after TOP, enter the desired number of records. When the statement executes, the WHERE condition would be applied on only the first Number of records. Any record that falls in that condition would be deleted. Here is an example:

DELETE TOP (4) FROM Employees
WHERE HourlySalary < 12.50;
GO

This code asks the database engine to delete any record in the first four records of the Employees table if that hourly salary of the employee in less than 12.50.

Conditionally Removing the First Percentage of Records

If you don't want to specify a fixed number of records, you can use a percentage instead. The formula to follow is:

DELETE TOP (Number) PERCENT FROM TableName
WHERE Condition(s)

In the parentheses, enter a number between 0.00 and 100.00 included. The number of records to consider is based on the total number of the records using a percentage. Here is an example:

DELETE TOP (40) PERCENT FROM Employees
WHERE HourlySalary < 12.50;
GO

This code delete any record whose salary is less than 12.50 but the record must be among the first 40% of the records.

Outputting the Deleted Results

When some record(s) has(have) been deleted, the operation is performed behind the scenes and you don't see the result. If you want to see a list of the records that were deleted, you can use the OUTPUT operator to display the result. To show the list of the records from a table that was completely emptied, you can use the following formula:

DELETE FROM TableName
OUTPUT DELETED.Columns

The OUTPUT INSERTED expression follows the description we have seen for the record update. Here is an example:

USE VideoCollection6;
GO

DELETE FROM Videos
OUTPUT deleted.*
GO

To show the list of the records that were deleted based on a condition, use the following formula:

DELETE FROM TableName
OUTPUT DELETED.Columns
WHERE Condition(s)

 Here is an example:

USE VideoCollection6;
GO

DELETE FROM Videos
OUTPUT deleted.*
WHERE YearReleased IS NULL;
GO

Practical LearningPractical Learning: Deleting all Records and Showing the Result

  1. Click the SQLQuery1.sql tab
  2. Click inside the Query window and press Ctrl + A
  3. To remove the records of all apartments, type:
    DELETE FROM Presentation.Units
    OUTPUT DELETED.*;
    GO
    Deleting Records
  4. Click inside the Query window and press Ctrl + A
  5. To change the database, type:
    SELECT * FROM Presentation.Units;
    GO
  6. To see the new result, on the SQL Editor toolbar, click the Execute button Execute
     
    Seeing the Result After Deleting Records
  7. Click inside the Query window and press Ctrl + A
  8. To change the database, type:
    quit
  9. To see the new result, on the SQL Editor toolbar, click the Execute button Execute (if you receive an error, after you have closed Microsoft SQL Server, open it again, right-click LambdaSquare1 from the Object Explorer and click Delete)
  10. Close Microsoft SQL Server
  11. When asked whether you want to save, click No
  12. Start Microsoft SQL Server
    1. If Microsoft SQL Server is installed in the computer you are using, in the Authentication combo box, select Windows Authentication
    2. If you are connecting to another computer, provide the necessary information. For example, select or type the name of the server in the Server Name combo box. If (since) you (should) already have a login account on the server, in the Authentication combo box, select Windows Authentication, then ignore the User Name and Password boxes. Otherwise, in the Authentication combo box, select SQL Server Authentication. In this case, in the User Name combo box, type the name of the domain followed by \ and followed by your login name; then, in the Password text box, type the necessary password
  13. Click Connect
  14. In the Object Explorer, right-click the name of the server and click Start PowerShell
  15. Type sqlcmd and press Enter
  16. Type use master; and press Enter
  17. Type go and press Enter
  18. Type drop database funds1; and press Enter
  19. Type go and press Enter (if you receive an error that the database cannot be deleted, after closing the PowerShell and closing Microsoft SQL Server, re-start Microsoft SQL Server; in the Object Explorer, right-click FunDS1 and click Delete)
  20. Type quit
  21. Ppress Enter
  22. Type exit

    Dropping a Database
  23. Press Enter
  24. In the Object Explorer of SQL Server Management, right-click the name of the server and click New Query
  25. Type the following:
    USE master;
    GO
    
    DROP DATABASE LambdaSquare1;
    GO
  26. To execute, on the main menu, click Query -> Execute
     
    Dropping a Database
  27. Close Microsoft SQL Server
  28. When asked whether you want to save, click No

Exercises

   

Lesson Summary Questions

  1. What is the basic formula to edit a record of a table?
    1. UPDATE ColumnName AS Expression FROM TableName
    2. UPDATE TableName SET ColumnName Operator Expression
    3. EDIT TableName SET ColumnName Operator Expression
    4. UPDATE ColumnName FROM TableName SET ColumnName = NewValue
    5. EDIT ColumnName FROM TableName SET ColumnName Operator Expression
  2. What is the formula to delete all records from a table?
    1. DROP TableName;
    2. REMOVE [FROM] TableName;
    3. DELETE [FROM] TableName;
    4. EXECUTE sp_removetable TableName;
    5. KILL ALL [FROM] TableName;
  3. What is the formula to change a specific record or specific records of a table?
    1. CHANGE TableName
      SET ColumnName = Expression
      WITH Condition(s)
    2. UPDATE TableName
      WHERE Condition(s)
      SET ColumnName = Expression
    3. EDIT TableName
      SET ColumnName = Expression
      WHERE Condition(s)
    4. UPDATE TableName
      SET ColumnName = Expression
      WHERE Condition(s)
    5. ALTER TableName
      WHERE Condition(s)
      SET ColumnName = Expression
  4. What is the formula to remove a specific record or to remove specific records of a table?
    1. DELETE FROM TableName
      WHERE Condition(s)
    2. DROP TableName
      WHERE Condition(s)
    3. CHANGE ROWS TableName
      WHERE Condition(s)
    4. DELETE FROM TableName
      SET Condition(s) = NULL
    5. ALTER TableName
      SET ColumnName = NULL
  5. If you want to change one or more records from a table and you want to show the result when the operation ends, what formula would you use?
    1. UPDATE TableName
      OUTPUT UPDATED.Columns
      SET ColumnName = Expression
      VALUES(Value_1, Value_2, Value_X)
    2. UPDATE TableName
      SET ColumnName = Expression
      VALUES(Value_1, Value_2, Value_X)
      OUTPUT CHANGED.Columns
    3. UPDATE TableName
      SET ColumnName = Expression
      PRINT UPDATED ROWS
      VALUES(Value_1, Value_2, Value_X)
    4. UPDATE TableName
      SET ColumnName = Expression
      SHOW INSERTED.Columns
      FOR(Value_1, Value_2, Value_X)
    5. UPDATE TableName
      SET ColumnName = Expression
      OUTPUT INSERTED.Columns
      VALUES(Value_1, Value_2, Value_X)
  6. If you want to delete some record(s) and show the result when the operation ends, what formula would you use?
    1. DELETE FROM TableName
      OUTPUT REMOVED.Columns
      WHERE Condition(s)
    2. DELETE FROM TableName
      OUTPUT DELETED.Columns
      WHERE Condition(s)
    3. DROP FROM TableName
      OUTPUT REMOVED.Columns
      WHERE Condition(s)
    4. DELETE FROM TableName
      SHOW DELETED ROWS(Columns)
      WHERE Condition(s)
    5. DROP TableName
      OUTPUT DELETED.Columns
      WHERE Condition(s)

Answers

  1. Answers
    1. Wrong Answer: The UPDATE operator must indicate a table
    2. Right Anwer: That's the right formula
    3. Wrong Answer: There is no EDIT operator in SQL
    4. Wrong Answer: The UPDATE operator first indicates a table. Besides the assignment is not the only operation used to update a record
    5. Wrong Answer: There is no EDIT operator in SQL
  2. Answers
    1. Wrong Answer: That formula will delete the table itself, including its records
    2. Wrong Answer: There is no REMOVE operator in SQL
    3. Right Anwer: That's the right formula
    4. Wrong Answer: There is no stored procedure name sp_removetable
    5. Wrong Anwer: There is no KILL FROM clause
  3. Answers
    1. Wrong Answer:
    2. Wrong Answer:
    3. Wrong Answer:
    4. Right Anwer: That's the right formula
    5. Wrong Anwer:
  4. Answers
    1. Right Anwer: That's the right formula
    2. Wrong Answer:
    3. Wrong Answer:
    4. Wrong Answer:
    5. Wrong Anwer:
  5. Answers
    1. Wrong Answer:
    2. Wrong Answer:
    3. Wrong Answer:
    4. Wrong Anwer:
    5. Right Anwer: That's the right formula
  6. Answers
    1. Wrong Answer:
    2. Right Anwer: That's the right formula
    3. Wrong Answer:
    4. Wrong Answer:
    5. Wrong Anwer:
 
 
       
 

Previous Copyright © 2009-2016, FunctionX, Inc. Next